Compare commits

...

5 Commits

7 changed files with 86 additions and 3 deletions

View File

@ -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.WithdrawalApplyAddRequest;
import com.greenorange.promotion.model.dto.withdrawalApply.WithdrawalApplyQueryRequest; import com.greenorange.promotion.model.dto.withdrawalApply.WithdrawalApplyQueryRequest;
import com.greenorange.promotion.model.entity.FundsChange; 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.entity.WithdrawalApply;
import com.greenorange.promotion.model.vo.fundsChange.FundsChangeVO; 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.model.vo.withdrawalApply.WithdrawalApplyVO;
import com.greenorange.promotion.service.common.CommonService; import com.greenorange.promotion.service.common.CommonService;
import com.greenorange.promotion.service.settle.FundsChangeService; import com.greenorange.promotion.service.settle.FundsChangeService;
import com.greenorange.promotion.service.settle.WithdrawalApplyService; 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.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
@ -50,6 +53,9 @@ public class WithdrawalApplyController {
@Resource @Resource
private CommonService commonService; private CommonService commonService;
@Resource
private UserMainInfoService userMainInfoService;
/** /**
* 小程序端用户申请提现 * 小程序端用户申请提现
@ -96,11 +102,16 @@ public class WithdrawalApplyController {
@Operation(summary = "小程序端用户查询资金变动记录", description = "参数权限管理员方法名queryFundsChangeByUserId") @Operation(summary = "小程序端用户查询资金变动记录", description = "参数权限管理员方法名queryFundsChangeByUserId")
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE) @RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
// @SysLog(title = "提现申请记录管理", content = "小程序端用户查询资金变动记录") // @SysLog(title = "提现申请记录管理", content = "小程序端用户查询资金变动记录")
public BaseResponse<List<FundsChangeVO>> queryFundsChangeByUserId(HttpServletRequest request) { public BaseResponse<FundsItemVO> queryFundsChangeByUserId(HttpServletRequest request) {
Long userId = (Long) request.getAttribute("userId"); Long userId = (Long) request.getAttribute("userId");
LambdaQueryWrapper<UserMainInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(UserMainInfo::getUserId, userId);
UserMainInfo userMainInfo = userMainInfoService.getOne(lambdaQueryWrapper);
FundsItemVO fundsItemVO = commonService.copyProperties(userMainInfo, FundsItemVO.class);
List<FundsChange> fundsChangeList = commonService.findByFieldEqTargetField(FundsChange::getUserId, userId, fundsChangeService); List<FundsChange> fundsChangeList = commonService.findByFieldEqTargetField(FundsChange::getUserId, userId, fundsChangeService);
List<FundsChangeVO> fundsChangeVOS = commonService.convertList(fundsChangeList, FundsChangeVO.class); List<FundsChangeVO> fundsChangeVOS = commonService.convertList(fundsChangeList, FundsChangeVO.class);
return ResultUtils.success(fundsChangeVOS); fundsItemVO.setFundsChangeVOList(fundsChangeVOS);
return ResultUtils.success(fundsItemVO);
} }

View File

@ -88,7 +88,7 @@ public class UserAccountController {
* @return 用户账户信息 * @return 用户账户信息
*/ */
@PostMapping("queryById") @PostMapping("queryById")
@Operation(summary = "web端管理员根据id查询用户账户", description = "参数权限管理员方法名queryUserAccountByUserId") @Operation(summary = "小程序端根据id查询用户账户", description = "参数权限管理员方法名queryUserAccountByUserId")
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE) @RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
// @SysLog(title = "用户账户管理", content = "web端管理员根据id查询用户账户") // @SysLog(title = "用户账户管理", content = "web端管理员根据id查询用户账户")
public BaseResponse<UserAccountVO> queryUserAccountByUserId(HttpServletRequest request) { public BaseResponse<UserAccountVO> queryUserAccountByUserId(HttpServletRequest request) {

View File

@ -18,6 +18,7 @@ import java.io.Serializable;
"idCardNumber", "idCardNumber",
"phoneNumber", "phoneNumber",
"bankCardNumber", "bankCardNumber",
"openBank",
"userId", "userId",
}) })
public class UserAccountAddRequest implements Serializable { public class UserAccountAddRequest implements Serializable {
@ -50,6 +51,13 @@ public class UserAccountAddRequest implements Serializable {
@Schema(description = "银行卡号", example = "5105105105105100") @Schema(description = "银行卡号", example = "5105105105105100")
private String bankCardNumber; private String bankCardNumber;
/**
* 开户银行
*/
@NotBlank(message = "开户银行不能为空")
@Schema(description = "开户银行", example = "中国工商银行")
private String openBank;
@Serial @Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -52,6 +52,13 @@ public class UserAccountQueryRequest extends PageRequest implements Serializable
@Schema(description = "银行卡号", example = "5105105105105100") @Schema(description = "银行卡号", example = "5105105105105100")
private String bankCardNumber; private String bankCardNumber;
/**
* 开户银行
*/
@NotBlank(message = "开户银行不能为空")
@Schema(description = "开户银行", example = "中国工商银行")
private String openBank;
/** /**
* 用户ID * 用户ID
*/ */

View File

@ -19,6 +19,7 @@ import java.io.Serializable;
"idCardNumber", "idCardNumber",
"phoneNumber", "phoneNumber",
"bankCardNumber", "bankCardNumber",
"openBank",
"userId", "userId",
}) })
public class UserAccountUpdateRequest implements Serializable { public class UserAccountUpdateRequest implements Serializable {
@ -58,6 +59,13 @@ public class UserAccountUpdateRequest implements Serializable {
@Schema(description = "银行卡号", example = "5105105105105100") @Schema(description = "银行卡号", example = "5105105105105100")
private String bankCardNumber; private String bankCardNumber;
/**
* 开户银行
*/
@NotBlank(message = "开户银行不能为空")
@Schema(description = "开户银行", example = "中国工商银行")
private String openBank;
@Serial @Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -6,6 +6,7 @@ import lombok.Data;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* 资金变动记录 视图对象 * 资金变动记录 视图对象
@ -38,6 +39,12 @@ public class FundsChangeVO implements Serializable {
@Schema(description = "当前金额(变动后的总金额)", example = "0.34") @Schema(description = "当前金额(变动后的总金额)", example = "0.34")
private BigDecimal currentAmount; private BigDecimal currentAmount;
/**
* 创建时间
*/
@Schema(description = "创建时间", example = "2023-02-01 09:09:09")
private Date createTime;
@Serial @Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -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<FundsChangeVO> fundsChangeVOList;
}