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; + +}