mirror of
				https://github.com/YunaiV/ruoyi-vue-pro.git
				synced 2025-10-31 10:37:41 +08:00 
			
		
		
		
	✨ Pay:增加钱包流水统计接口
This commit is contained in:
		| @ -3,24 +3,30 @@ package cn.iocoder.yudao.module.pay.controller.app.wallet; | |||||||
| import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | ||||||
| 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.pojo.PageResult; | ||||||
|  | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||||||
|  | import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionSummaryRespVO; | ||||||
| import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO; | import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO; | ||||||
| import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionRespVO; | import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionRespVO; | ||||||
| import cn.iocoder.yudao.module.pay.convert.wallet.PayWalletTransactionConvert; |  | ||||||
| import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletTransactionDO; | import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletTransactionDO; | ||||||
| import cn.iocoder.yudao.module.pay.service.wallet.PayWalletTransactionService; | import cn.iocoder.yudao.module.pay.service.wallet.PayWalletTransactionService; | ||||||
| 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.tags.Tag; | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||||
|  | import org.springframework.format.annotation.DateTimeFormat; | ||||||
| import org.springframework.validation.annotation.Validated; | import org.springframework.validation.annotation.Validated; | ||||||
| import org.springframework.web.bind.annotation.GetMapping; | import org.springframework.web.bind.annotation.GetMapping; | ||||||
| import org.springframework.web.bind.annotation.RequestMapping; | import org.springframework.web.bind.annotation.RequestMapping; | ||||||
|  | import org.springframework.web.bind.annotation.RequestParam; | ||||||
| import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||||
|  |  | ||||||
| import jakarta.annotation.Resource; | import jakarta.annotation.Resource; | ||||||
| import jakarta.validation.Valid; | import jakarta.validation.Valid; | ||||||
|  |  | ||||||
| import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||||
|  |  | ||||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||||
|  | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||||
| import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | ||||||
|  |  | ||||||
| @Tag(name = "用户 APP - 钱包余额明细") | @Tag(name = "用户 APP - 钱包余额明细") | ||||||
| @ -37,16 +43,19 @@ public class AppPayWalletTransactionController { | |||||||
|     @Operation(summary = "获得钱包流水分页") |     @Operation(summary = "获得钱包流水分页") | ||||||
|     public CommonResult<PageResult<AppPayWalletTransactionRespVO>> getWalletTransactionPage( |     public CommonResult<PageResult<AppPayWalletTransactionRespVO>> getWalletTransactionPage( | ||||||
|             @Valid AppPayWalletTransactionPageReqVO pageReqVO) { |             @Valid AppPayWalletTransactionPageReqVO pageReqVO) { | ||||||
|         if (true) { |         PageResult<PayWalletTransactionDO> pageResult = payWalletTransactionService.getWalletTransactionPage( | ||||||
|             PageResult<AppPayWalletTransactionRespVO> result = new PageResult<>(10L); |                 getLoginUserId(), UserTypeEnum.MEMBER.getValue(), pageReqVO); | ||||||
|             result.getList().add(new AppPayWalletTransactionRespVO().setPrice(1L) |         return success(BeanUtils.toBean(pageResult, AppPayWalletTransactionRespVO.class)); | ||||||
|                     .setTitle("测试").setCreateTime(LocalDateTime.now())); |  | ||||||
|             result.getList().add(new AppPayWalletTransactionRespVO().setPrice(-1L) |  | ||||||
|                     .setTitle("测试2").setCreateTime(LocalDateTime.now())); |  | ||||||
|             return success(result); |  | ||||||
|         } |  | ||||||
|         PageResult<PayWalletTransactionDO> result = payWalletTransactionService.getWalletTransactionPage(getLoginUserId(), |  | ||||||
|                 UserTypeEnum.MEMBER.getValue(), pageReqVO); |  | ||||||
|         return success(PayWalletTransactionConvert.INSTANCE.convertPage(result)); |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @GetMapping("/get-summary") | ||||||
|  |     @Operation(summary = "获得钱包流水统计") | ||||||
|  |     @Parameter(name = "times", description = "时间段", required = true) | ||||||
|  |     public CommonResult<AppPayWalletTransactionSummaryRespVO> getWalletTransactionSummary( | ||||||
|  |             @RequestParam("createTime") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) LocalDateTime[] createTime) { | ||||||
|  |         AppPayWalletTransactionSummaryRespVO summary = payWalletTransactionService.getWalletTransactionSummary( | ||||||
|  |                 getLoginUserId(), UserTypeEnum.MEMBER.getValue(), createTime); | ||||||
|  |         return success(summary); | ||||||
|  |     } | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,8 +1,12 @@ | |||||||
| package cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction; | package cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction; | ||||||
|  |  | ||||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||||
|  | import cn.iocoder.yudao.framework.common.util.date.DateUtils; | ||||||
| import io.swagger.v3.oas.annotations.media.Schema; | import io.swagger.v3.oas.annotations.media.Schema; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
|  | import org.springframework.format.annotation.DateTimeFormat; | ||||||
|  |  | ||||||
|  | import java.time.LocalDateTime; | ||||||
|  |  | ||||||
| @Schema(description = "用户 APP - 钱包流水分页 Request VO") | @Schema(description = "用户 APP - 钱包流水分页 Request VO") | ||||||
| @Data | @Data | ||||||
| @ -20,4 +24,8 @@ public class AppPayWalletTransactionPageReqVO extends PageParam { | |||||||
|     @Schema(description = "类型",  example = "1") |     @Schema(description = "类型",  example = "1") | ||||||
|     private Integer type; |     private Integer type; | ||||||
|  |  | ||||||
|  |     @Schema(description = "创建时间") | ||||||
|  |     @DateTimeFormat(pattern = DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||||
|  |     private LocalDateTime[] createTime; | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -0,0 +1,16 @@ | |||||||
|  | package cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction; | ||||||
|  |  | ||||||
|  | import io.swagger.v3.oas.annotations.media.Schema; | ||||||
|  | import lombok.Data; | ||||||
|  |  | ||||||
|  | @Schema(description = "用户 APP - 钱包流水统计 Request VO") | ||||||
|  | @Data | ||||||
|  | public class AppPayWalletTransactionSummaryRespVO { | ||||||
|  |  | ||||||
|  |     @Schema(description = "累计支出,单位分", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000") | ||||||
|  |     private Integer totalExpense; | ||||||
|  |  | ||||||
|  |     @Schema(description = "累计收入,单位分", requiredMode = Schema.RequiredMode.REQUIRED, example = "2000") | ||||||
|  |     private Integer totalIncome; | ||||||
|  |  | ||||||
|  | } | ||||||
| @ -7,13 +7,13 @@ import lombok.Data; | |||||||
| @Data | @Data | ||||||
| public class AppPayWalletRespVO { | public class AppPayWalletRespVO { | ||||||
|  |  | ||||||
|     @Schema(description = "钱包余额,单位分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") |     @Schema(description = "钱包余额,单位分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") | ||||||
|     private Integer balance; |     private Integer balance; | ||||||
|  |  | ||||||
|     @Schema(description = "累计支出, 单位分", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000") |     @Schema(description = "累计支出,单位分", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000") | ||||||
|     private Integer totalExpense; |     private Integer totalExpense; | ||||||
|  |  | ||||||
|     @Schema(description = "累计充值, 单位分", requiredMode = Schema.RequiredMode.REQUIRED, example = "2000") |     @Schema(description = "累计充值,单位分", requiredMode = Schema.RequiredMode.REQUIRED, example = "2000") | ||||||
|     private Integer totalRecharge; |     private Integer totalRecharge; | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -13,8 +13,6 @@ public interface PayWalletTransactionConvert { | |||||||
|  |  | ||||||
|     PayWalletTransactionConvert INSTANCE = Mappers.getMapper(PayWalletTransactionConvert.class); |     PayWalletTransactionConvert INSTANCE = Mappers.getMapper(PayWalletTransactionConvert.class); | ||||||
|  |  | ||||||
|     PageResult<AppPayWalletTransactionRespVO> convertPage(PageResult<PayWalletTransactionDO> page); |  | ||||||
|  |  | ||||||
|     PageResult<PayWalletTransactionRespVO> convertPage2(PageResult<PayWalletTransactionDO> page); |     PageResult<PayWalletTransactionRespVO> convertPage2(PageResult<PayWalletTransactionDO> page); | ||||||
|  |  | ||||||
|     PayWalletTransactionDO convert(WalletTransactionCreateReqBO bean); |     PayWalletTransactionDO convert(WalletTransactionCreateReqBO bean); | ||||||
|  | |||||||
| @ -1,32 +1,56 @@ | |||||||
| package cn.iocoder.yudao.module.pay.dal.mysql.wallet; | package cn.iocoder.yudao.module.pay.dal.mysql.wallet; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | import cn.hutool.core.collection.CollUtil; | ||||||
|  | import cn.hutool.core.map.MapUtil; | ||||||
| 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.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.framework.mybatis.core.query.QueryWrapperX; | ||||||
| import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO; | import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO; | ||||||
| import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletTransactionDO; | import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletTransactionDO; | ||||||
|  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||||
| import org.apache.ibatis.annotations.Mapper; | import org.apache.ibatis.annotations.Mapper; | ||||||
|  |  | ||||||
|  | import java.time.LocalDateTime; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.Map; | ||||||
| import java.util.Objects; | import java.util.Objects; | ||||||
|  | import java.util.function.Consumer; | ||||||
|  |  | ||||||
|  | import static cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO.*; | ||||||
|  |  | ||||||
| @Mapper | @Mapper | ||||||
| public interface PayWalletTransactionMapper extends BaseMapperX<PayWalletTransactionDO> { | public interface PayWalletTransactionMapper extends BaseMapperX<PayWalletTransactionDO> { | ||||||
|  |  | ||||||
|     default PageResult<PayWalletTransactionDO> selectPage(Long walletId, Integer type, |     default PageResult<PayWalletTransactionDO> selectPage(Long walletId, Integer type, | ||||||
|                                                           PageParam pageParam) { |                                                           PageParam pageParam, LocalDateTime[] createTime) { | ||||||
|         LambdaQueryWrapperX<PayWalletTransactionDO> query = new LambdaQueryWrapperX<PayWalletTransactionDO>() |         LambdaQueryWrapperX<PayWalletTransactionDO> query = new LambdaQueryWrapperX<PayWalletTransactionDO>() | ||||||
|                 .eqIfPresent(PayWalletTransactionDO::getWalletId, walletId); |                 .eqIfPresent(PayWalletTransactionDO::getWalletId, walletId); | ||||||
|         if (Objects.equals(type, AppPayWalletTransactionPageReqVO.TYPE_INCOME)) { |         if (Objects.equals(type, TYPE_INCOME)) { | ||||||
|             query.gt(PayWalletTransactionDO::getPrice, 0); |             query.gt(PayWalletTransactionDO::getPrice, 0); | ||||||
|         } else if (Objects.equals(type, AppPayWalletTransactionPageReqVO.TYPE_EXPENSE)) { |         } else if (Objects.equals(type, TYPE_EXPENSE)) { | ||||||
|             query.lt(PayWalletTransactionDO::getPrice, 0); |             query.lt(PayWalletTransactionDO::getPrice, 0); | ||||||
|         } |         } | ||||||
|  |         query.betweenIfPresent(PayWalletTransactionDO::getCreateTime, createTime); | ||||||
|         query.orderByDesc(PayWalletTransactionDO::getId); |         query.orderByDesc(PayWalletTransactionDO::getId); | ||||||
|         return selectPage(pageParam, query); |         return selectPage(pageParam, query); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     default Integer selectPriceSum(Long walletId, Integer type, LocalDateTime[] createTime) { | ||||||
|  |         // SQL sum 查询 | ||||||
|  |         List<Map<String, Object>> result = selectMaps(new QueryWrapperX<PayWalletTransactionDO>() | ||||||
|  |                 .select("SUM(price) AS priceSum") | ||||||
|  |                 .gt(Objects.equals(type, TYPE_INCOME), "price", 0) // 收入 | ||||||
|  |                 .lt(Objects.equals(type, TYPE_EXPENSE), "price", 0) // 支出 | ||||||
|  |                 .eq("wallet_id", walletId) | ||||||
|  |                 .between("create_time", createTime[0], createTime[1])); | ||||||
|  |         // 获得 sum 结果 | ||||||
|  |         Map<String, Object> first = CollUtil.getFirst(result); | ||||||
|  |         return MapUtil.getInt(first, "priceSum", 0); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     default PayWalletTransactionDO selectByNo(String no) { |     default PayWalletTransactionDO selectByNo(String no) { | ||||||
|         return selectOne(PayWalletTransactionDO::getNo, no); |         return selectOne(PayWalletTransactionDO::getNo, no); | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -3,12 +3,15 @@ package cn.iocoder.yudao.module.pay.service.wallet; | |||||||
| 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.transaction.PayWalletTransactionPageReqVO; | import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.transaction.PayWalletTransactionPageReqVO; | ||||||
| import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO; | import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO; | ||||||
|  | import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionSummaryRespVO; | ||||||
| import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletTransactionDO; | import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletTransactionDO; | ||||||
| import cn.iocoder.yudao.module.pay.enums.wallet.PayWalletBizTypeEnum; | import cn.iocoder.yudao.module.pay.enums.wallet.PayWalletBizTypeEnum; | ||||||
| import cn.iocoder.yudao.module.pay.service.wallet.bo.WalletTransactionCreateReqBO; | import cn.iocoder.yudao.module.pay.service.wallet.bo.WalletTransactionCreateReqBO; | ||||||
|  |  | ||||||
| import jakarta.validation.Valid; | import jakarta.validation.Valid; | ||||||
|  |  | ||||||
|  | import java.time.LocalDateTime; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * 钱包余额流水 Service 接口 |  * 钱包余额流水 Service 接口 | ||||||
|  * |  * | ||||||
| @ -57,4 +60,15 @@ public interface PayWalletTransactionService { | |||||||
|      */ |      */ | ||||||
|     PayWalletTransactionDO getWalletTransaction(String bizId, PayWalletBizTypeEnum type); |     PayWalletTransactionDO getWalletTransaction(String bizId, PayWalletBizTypeEnum type); | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 获得钱包流水统计 | ||||||
|  |      * | ||||||
|  |      * @param userId 用户编号 | ||||||
|  |      * @param userType 用户类型 | ||||||
|  |      * @param createTime 时间段 | ||||||
|  |      * @return 钱包流水统计 | ||||||
|  |      */ | ||||||
|  |     AppPayWalletTransactionSummaryRespVO getWalletTransactionSummary(Long userId, Integer userType, | ||||||
|  |                                                                      LocalDateTime[] createTime); | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -3,6 +3,7 @@ package cn.iocoder.yudao.module.pay.service.wallet; | |||||||
| 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.transaction.PayWalletTransactionPageReqVO; | import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.transaction.PayWalletTransactionPageReqVO; | ||||||
| import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO; | import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO; | ||||||
|  | import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionSummaryRespVO; | ||||||
| import cn.iocoder.yudao.module.pay.convert.wallet.PayWalletTransactionConvert; | import cn.iocoder.yudao.module.pay.convert.wallet.PayWalletTransactionConvert; | ||||||
| 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.PayWalletTransactionDO; | import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletTransactionDO; | ||||||
| @ -16,6 +17,11 @@ import org.springframework.validation.annotation.Validated; | |||||||
|  |  | ||||||
| import jakarta.annotation.Resource; | import jakarta.annotation.Resource; | ||||||
|  |  | ||||||
|  | import java.time.LocalDateTime; | ||||||
|  |  | ||||||
|  | import static cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO.TYPE_EXPENSE; | ||||||
|  | import static cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO.TYPE_INCOME; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * 钱包流水 Service 实现类 |  * 钱包流水 Service 实现类 | ||||||
|  * |  * | ||||||
| @ -42,12 +48,12 @@ public class PayWalletTransactionServiceImpl implements PayWalletTransactionServ | |||||||
|     public PageResult<PayWalletTransactionDO> getWalletTransactionPage(Long userId, Integer userType, |     public PageResult<PayWalletTransactionDO> getWalletTransactionPage(Long userId, Integer userType, | ||||||
|                                                                        AppPayWalletTransactionPageReqVO pageVO) { |                                                                        AppPayWalletTransactionPageReqVO pageVO) { | ||||||
|         PayWalletDO wallet = payWalletService.getOrCreateWallet(userId, userType); |         PayWalletDO wallet = payWalletService.getOrCreateWallet(userId, userType); | ||||||
|         return payWalletTransactionMapper.selectPage(wallet.getId(), pageVO.getType(), pageVO); |         return payWalletTransactionMapper.selectPage(wallet.getId(), pageVO.getType(), pageVO, pageVO.getCreateTime()); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public PageResult<PayWalletTransactionDO> getWalletTransactionPage(PayWalletTransactionPageReqVO pageVO) { |     public PageResult<PayWalletTransactionDO> getWalletTransactionPage(PayWalletTransactionPageReqVO pageVO) { | ||||||
|         return payWalletTransactionMapper.selectPage(pageVO.getWalletId(), null, pageVO); |         return payWalletTransactionMapper.selectPage(pageVO.getWalletId(), null, pageVO, null); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
| @ -68,4 +74,14 @@ public class PayWalletTransactionServiceImpl implements PayWalletTransactionServ | |||||||
|         return payWalletTransactionMapper.selectByBiz(bizId, type.getType()); |         return payWalletTransactionMapper.selectByBiz(bizId, type.getType()); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     public AppPayWalletTransactionSummaryRespVO getWalletTransactionSummary(Long userId, Integer userType, LocalDateTime[] createTime) { | ||||||
|  |         PayWalletDO wallet = payWalletService.getOrCreateWallet(userId, userType); | ||||||
|  |         AppPayWalletTransactionSummaryRespVO summary = new AppPayWalletTransactionSummaryRespVO() | ||||||
|  |                 .setTotalExpense(1).setTotalIncome(100); | ||||||
|  |         return new AppPayWalletTransactionSummaryRespVO() | ||||||
|  |                 .setTotalExpense(payWalletTransactionMapper.selectPriceSum(wallet.getId(), TYPE_EXPENSE, createTime)) | ||||||
|  |                 .setTotalIncome(payWalletTransactionMapper.selectPriceSum(wallet.getId(), TYPE_INCOME, createTime)); | ||||||
|  |     } | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV