mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-02-08 14:44:57 +08:00
wallet - 管理端 钱包余额查询
This commit is contained in:
parent
e06f61ef39
commit
7cb8f8fab9
@ -1,8 +1,10 @@
|
||||
package cn.iocoder.yudao.module.pay.controller.admin.wallet;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.PayWalletRespVO;
|
||||
import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.PayWalletUserReqVO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.balance.PayWalletPageReqVO;
|
||||
import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.balance.PayWalletRespVO;
|
||||
import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.balance.PayWalletUserReqVO;
|
||||
import cn.iocoder.yudao.module.pay.convert.wallet.PayWalletConvert;
|
||||
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO;
|
||||
import cn.iocoder.yudao.module.pay.service.wallet.PayWalletService;
|
||||
@ -16,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@ -37,4 +40,12 @@ public class PayWalletController {
|
||||
return success(PayWalletConvert.INSTANCE.convert02(wallet));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员钱包分页")
|
||||
@PreAuthorize("@ss.hasPermission('pay:wallet:query')")
|
||||
public CommonResult<PageResult<PayWalletRespVO>> getWalletPage(@Valid PayWalletPageReqVO pageVO) {
|
||||
PageResult<PayWalletDO> pageResult = payWalletService.getWalletPage(pageVO);
|
||||
return success(PayWalletConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo;
|
||||
package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.balance;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@ -18,7 +18,7 @@ public class PayWalletBaseVO {
|
||||
|
||||
@Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "用户类型不能为空")
|
||||
private Byte userType;
|
||||
private Integer userType;
|
||||
|
||||
@Schema(description = "余额,单位分", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "余额,单位分不能为空")
|
@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.balance;
|
||||
|
||||
import lombok.*;
|
||||
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 PayWalletPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户编号", example = "14138")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "用户类型", example = "1")
|
||||
private Integer userType;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo;
|
||||
package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.balance;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo;
|
||||
package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.balance;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.pay.convert.wallet;
|
||||
|
||||
import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.PayWalletRespVO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.balance.PayWalletRespVO;
|
||||
import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.wallet.AppPayWalletRespVO;
|
||||
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO;
|
||||
import org.mapstruct.Mapper;
|
||||
@ -14,4 +15,6 @@ public interface PayWalletConvert {
|
||||
AppPayWalletRespVO convert(PayWalletDO bean);
|
||||
|
||||
PayWalletRespVO convert02(PayWalletDO wallet);
|
||||
|
||||
PageResult<PayWalletRespVO> convertPage(PageResult<PayWalletDO> page);
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
package cn.iocoder.yudao.module.pay.dal.mysql.wallet;
|
||||
|
||||
|
||||
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.balance.PayWalletPageReqVO;
|
||||
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -14,6 +17,14 @@ public interface PayWalletMapper extends BaseMapperX<PayWalletDO> {
|
||||
PayWalletDO::getUserType, userType);
|
||||
}
|
||||
|
||||
default PageResult<PayWalletDO> selectPage(PayWalletPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PayWalletDO>()
|
||||
.eqIfPresent(PayWalletDO::getUserId, reqVO.getUserId())
|
||||
.eqIfPresent(PayWalletDO::getUserType, reqVO.getUserType())
|
||||
.betweenIfPresent(PayWalletDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(PayWalletDO::getId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 当消费退款时候, 更新钱包
|
||||
*
|
||||
|
@ -1,5 +1,7 @@
|
||||
package cn.iocoder.yudao.module.pay.service.wallet;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.balance.PayWalletPageReqVO;
|
||||
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO;
|
||||
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletTransactionDO;
|
||||
import cn.iocoder.yudao.module.pay.enums.member.PayWalletBizTypeEnum;
|
||||
@ -28,6 +30,15 @@ public interface PayWalletService {
|
||||
*/
|
||||
PayWalletDO getWallet(Long walletId);
|
||||
|
||||
|
||||
/**
|
||||
* 获得会员钱包分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 会员钱包分页
|
||||
*/
|
||||
PageResult<PayWalletDO> getWalletPage(PayWalletPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 钱包订单支付
|
||||
*
|
||||
|
@ -1,6 +1,8 @@
|
||||
package cn.iocoder.yudao.module.pay.service.wallet;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.balance.PayWalletPageReqVO;
|
||||
import cn.iocoder.yudao.module.pay.dal.dataobject.order.PayOrderExtensionDO;
|
||||
import cn.iocoder.yudao.module.pay.dal.dataobject.refund.PayRefundDO;
|
||||
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO;
|
||||
@ -60,6 +62,11 @@ public class PayWalletServiceImpl implements PayWalletService {
|
||||
return walletMapper.selectById(walletId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PayWalletDO> getWalletPage(PayWalletPageReqVO pageReqVO) {
|
||||
return walletMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public PayWalletTransactionDO orderPay(Long userId, Integer userType, String outTradeNo, Integer price) {
|
||||
|
Loading…
Reference in New Issue
Block a user