diff --git a/yudao-admin-vue3/src/api/pay/wallet/recharge/index.ts b/yudao-admin-vue3/src/api/pay/wallet/recharge/index.ts new file mode 100644 index 0000000..374febf --- /dev/null +++ b/yudao-admin-vue3/src/api/pay/wallet/recharge/index.ts @@ -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 }) + } +} \ No newline at end of file diff --git a/yudao-admin-vue3/src/utils/dict.ts b/yudao-admin-vue3/src/utils/dict.ts index 4c09a17..43b359e 100644 --- a/yudao-admin-vue3/src/utils/dict.ts +++ b/yudao-admin-vue3/src/utils/dict.ts @@ -126,6 +126,8 @@ export enum DICT_TYPE { INFRA_FILE_TYPE = 'infra_file_type', + PAY_WALLET_RECHARGE_PAY_STATUS = 'pay_wallet_recharge_pay_status', + //预约:项目 SUBSCRIBE_PROJECT_STATUS = 'subscribe_project_status', diff --git a/yudao-admin-vue3/src/views/mall/promotion/kefu/index.vue b/yudao-admin-vue3/src/views/mall/promotion/kefu/index.vue index 4fb14fb..383d948 100644 --- a/yudao-admin-vue3/src/views/mall/promotion/kefu/index.vue +++ b/yudao-admin-vue3/src/views/mall/promotion/kefu/index.vue @@ -44,7 +44,7 @@ 客户信息 交易订单 商品信息 - + diff --git a/yudao-admin-vue3/src/views/pay/wallet/recharge/WalletRechargeForm.vue b/yudao-admin-vue3/src/views/pay/wallet/recharge/WalletRechargeForm.vue new file mode 100644 index 0000000..332aa93 --- /dev/null +++ b/yudao-admin-vue3/src/views/pay/wallet/recharge/WalletRechargeForm.vue @@ -0,0 +1,181 @@ + + \ No newline at end of file diff --git a/yudao-admin-vue3/src/views/pay/wallet/recharge/index.vue b/yudao-admin-vue3/src/views/pay/wallet/recharge/index.vue new file mode 100644 index 0000000..5dcd9b5 --- /dev/null +++ b/yudao-admin-vue3/src/views/pay/wallet/recharge/index.vue @@ -0,0 +1,280 @@ + + + \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/supportstaff/SupportStaffMapper.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/supportstaff/SupportStaffMapper.java index c4e8088..0bc632d 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/supportstaff/SupportStaffMapper.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/supportstaff/SupportStaffMapper.java @@ -26,7 +26,7 @@ public interface SupportStaffMapper extends BaseMapperX { .eqIfPresent(SupportStaffDO::getOrderManage, reqVO.getOrderManage()) .eqIfPresent(SupportStaffDO::getOrderInform, reqVO.getOrderInform()) .betweenIfPresent(SupportStaffDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(SupportStaffDO::getId)); + .orderByAsc(SupportStaffDO::getId)); } } \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java index c8285e9..483ea7d 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java @@ -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.order.TradeOrderDO; 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.framework.order.config.TradeOrderProperties; import cn.iocoder.yudao.module.trade.service.aftersale.AfterSaleService; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/PayWalletRechargeController.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/PayWalletRechargeController.java index 97942c3..cfa53c3 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/PayWalletRechargeController.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/PayWalletRechargeController.java @@ -1,13 +1,20 @@ package cn.iocoder.yudao.module.pay.controller.admin.wallet; 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.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 io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -55,4 +62,12 @@ public class PayWalletRechargeController { return success(true); } + @GetMapping("/page") + @Operation(summary = "获得钱包充值分页") + @PreAuthorize("@ss.hasPermission('pay:wallet-recharge:query')") + public CommonResult> getWalletRechargePage(@Valid WalletRechargePageReqVO pageReqVO) { + PageResult pageResult = walletRechargeService.getWalletRechargePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, WalletRechargeRespVO.class)); + } + } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/recharge/WalletRechargePageReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/recharge/WalletRechargePageReqVO.java new file mode 100644 index 0000000..153c029 --- /dev/null +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/recharge/WalletRechargePageReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/recharge/WalletRechargeRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/recharge/WalletRechargeRespVO.java new file mode 100644 index 0000000..e08bb68 --- /dev/null +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/recharge/WalletRechargeRespVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/recharge/WalletRechargeSaveReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/recharge/WalletRechargeSaveReqVO.java new file mode 100644 index 0000000..f6d83e4 --- /dev/null +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/recharge/WalletRechargeSaveReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/wallet/PayWalletRechargeDO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/wallet/PayWalletRechargeDO.java index 831aa52..717edec 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/wallet/PayWalletRechargeDO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/wallet/PayWalletRechargeDO.java @@ -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.refund.PayRefundDO; import cn.iocoder.yudao.module.pay.enums.refund.PayRefundStatusEnum; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.KeySequence; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import java.time.LocalDateTime; @@ -114,4 +111,10 @@ public class PayWalletRechargeDO extends BaseDO { */ private Integer refundStatus; + @TableField(exist = false) + private String avatar; + + @TableField(exist = false) + private String name; + } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/wallet/WalletRechargeDO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/wallet/WalletRechargeDO.java new file mode 100644 index 0000000..7baea23 --- /dev/null +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/wallet/WalletRechargeDO.java @@ -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") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 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; + +} \ No newline at end of file diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/wallet/PayWalletRechargeMapper.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/wallet/PayWalletRechargeMapper.java index f82b885..dbb0f48 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/wallet/PayWalletRechargeMapper.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/wallet/PayWalletRechargeMapper.java @@ -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.mybatis.core.mapper.BaseMapperX; 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.PayWalletRechargePackageDO; +import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.WalletRechargeDO; import org.apache.ibatis.annotations.Mapper; @Mapper @@ -28,4 +30,25 @@ public interface PayWalletRechargeMapper extends BaseMapperX selectPage(WalletRechargePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .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)); + } + } \ No newline at end of file diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeService.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeService.java index f2de167..a76486f 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeService.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeService.java @@ -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.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.dal.dataobject.wallet.PayWalletRechargeDO; import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletRechargePackageDO; +import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.WalletRechargeDO; /** * 钱包充值 Service 接口 @@ -61,4 +63,12 @@ public interface PayWalletRechargeService { */ void updateWalletRechargeRefunded(Long id, Long payRefundId); + /** + * 获得钱包充值分页 + * + * @param pageReqVO 分页查询 + * @return 钱包充值分页 + */ + PageResult getWalletRechargePage(WalletRechargePageReqVO pageReqVO); + } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeServiceImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeServiceImpl.java index 3d6493a..ffa30fe 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeServiceImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeServiceImpl.java @@ -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.PageResult; 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.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.dal.dataobject.order.PayOrderDO; 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.PayWalletRechargeDO; 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.enums.wallet.PayWalletBizTypeEnum; 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 = "钱包余额充值"; + @Resource + private MemberUserApi memberUserApi; + @Resource private PayWalletRechargeMapper walletRechargeMapper; @Resource + private PayWalletMapper payWalletMapper; + @Resource private PayWalletService payWalletService; @Resource private PayOrderService payOrderService; @@ -205,6 +215,24 @@ public class PayWalletRechargeServiceImpl implements PayWalletRechargeService { walletRechargeMapper.updateByIdAndRefunded(id, WAITING.getStatus(), updateObj); } + @Override + public PageResult getWalletRechargePage(WalletRechargePageReqVO pageReqVO) { + PageResult 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) { // 1. 校验退款订单匹配 if (notEqual(walletRecharge.getPayRefundId(), payRefundId)) { @@ -295,4 +323,5 @@ public class PayWalletRechargeServiceImpl implements PayWalletRechargeService { return payOrder; } + }