From c5867e701731ee52e94238075aec391ae358148c Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Tue, 3 Jun 2025 11:33:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BA=86=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E7=AB=AF=E6=9F=A5=E8=AF=A2=E8=B5=84=E9=87=91=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WithdrawalApplyController.java | 15 ++++++- .../model/vo/fundsChange/FundsChangeVO.java | 7 ++++ .../model/vo/fundsChange/FundsItemVO.java | 42 +++++++++++++++++++ 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/greenorange/promotion/model/vo/fundsChange/FundsItemVO.java diff --git a/src/main/java/com/greenorange/promotion/controller/projectSettlement/WithdrawalApplyController.java b/src/main/java/com/greenorange/promotion/controller/projectSettlement/WithdrawalApplyController.java index 3f21ced..0c774bc 100644 --- a/src/main/java/com/greenorange/promotion/controller/projectSettlement/WithdrawalApplyController.java +++ b/src/main/java/com/greenorange/promotion/controller/projectSettlement/WithdrawalApplyController.java @@ -10,12 +10,15 @@ import com.greenorange.promotion.constant.UserConstant; import com.greenorange.promotion.model.dto.withdrawalApply.WithdrawalApplyAddRequest; import com.greenorange.promotion.model.dto.withdrawalApply.WithdrawalApplyQueryRequest; import com.greenorange.promotion.model.entity.FundsChange; +import com.greenorange.promotion.model.entity.UserMainInfo; import com.greenorange.promotion.model.entity.WithdrawalApply; import com.greenorange.promotion.model.vo.fundsChange.FundsChangeVO; +import com.greenorange.promotion.model.vo.fundsChange.FundsItemVO; import com.greenorange.promotion.model.vo.withdrawalApply.WithdrawalApplyVO; import com.greenorange.promotion.service.common.CommonService; import com.greenorange.promotion.service.settle.FundsChangeService; import com.greenorange.promotion.service.settle.WithdrawalApplyService; +import com.greenorange.promotion.service.userInfo.UserMainInfoService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; @@ -50,6 +53,9 @@ public class WithdrawalApplyController { @Resource private CommonService commonService; + @Resource + private UserMainInfoService userMainInfoService; + /** * 小程序端用户申请提现 @@ -96,11 +102,16 @@ public class WithdrawalApplyController { @Operation(summary = "小程序端用户查询资金变动记录", description = "参数:无,权限:管理员,方法名:queryFundsChangeByUserId") @RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE) // @SysLog(title = "提现申请记录管理", content = "小程序端用户查询资金变动记录") - public BaseResponse> queryFundsChangeByUserId(HttpServletRequest request) { + public BaseResponse queryFundsChangeByUserId(HttpServletRequest request) { Long userId = (Long) request.getAttribute("userId"); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(UserMainInfo::getUserId, userId); + UserMainInfo userMainInfo = userMainInfoService.getOne(lambdaQueryWrapper); + FundsItemVO fundsItemVO = commonService.copyProperties(userMainInfo, FundsItemVO.class); List fundsChangeList = commonService.findByFieldEqTargetField(FundsChange::getUserId, userId, fundsChangeService); List fundsChangeVOS = commonService.convertList(fundsChangeList, FundsChangeVO.class); - return ResultUtils.success(fundsChangeVOS); + fundsItemVO.setFundsChangeVOList(fundsChangeVOS); + return ResultUtils.success(fundsItemVO); } diff --git a/src/main/java/com/greenorange/promotion/model/vo/fundsChange/FundsChangeVO.java b/src/main/java/com/greenorange/promotion/model/vo/fundsChange/FundsChangeVO.java index 96289c8..122178f 100644 --- a/src/main/java/com/greenorange/promotion/model/vo/fundsChange/FundsChangeVO.java +++ b/src/main/java/com/greenorange/promotion/model/vo/fundsChange/FundsChangeVO.java @@ -6,6 +6,7 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; /** * 资金变动记录 视图对象 @@ -38,6 +39,12 @@ public class FundsChangeVO implements Serializable { @Schema(description = "当前金额(变动后的总金额)", example = "0.34") private BigDecimal currentAmount; + /** + * 创建时间 + */ + @Schema(description = "创建时间", example = "2023-02-01 09:09:09") + private Date createTime; + @Serial private static final long serialVersionUID = 1L; diff --git a/src/main/java/com/greenorange/promotion/model/vo/fundsChange/FundsItemVO.java b/src/main/java/com/greenorange/promotion/model/vo/fundsChange/FundsItemVO.java new file mode 100644 index 0000000..6b36784 --- /dev/null +++ b/src/main/java/com/greenorange/promotion/model/vo/fundsChange/FundsItemVO.java @@ -0,0 +1,42 @@ +package com.greenorange.promotion.model.vo.fundsChange; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + + +/** + * 资金明细 视图对象 + */ +@Data +@Schema(description = "资金明细 视图对象") +public class FundsItemVO implements Serializable { + + /** + * 当前余额 + */ + @Schema(description = "当前余额", example = "10.00") + private BigDecimal currentBalance; + + /** + * 提现中的金额 + */ + @Schema(description = "提现中的金额", example = "15.00") + private BigDecimal withdrawalAmount; + + /** + * 已提现的金额 + */ + @Schema(description = "已提现的金额", example = "20.00") + private BigDecimal withdrawnAmount; + + /** + * 资金明细变动记录列表 + */ + @Schema(description = "资金明细变动记录列表") + private List fundsChangeVOList; + +}