新增后台 提现信息查询 审核功能
This commit is contained in:
parent
f6c82f83a9
commit
eca8178852
@ -0,0 +1,15 @@
|
||||
package com.red.circle.wallet.inner.endpoint.bank;
|
||||
|
||||
import com.red.circle.wallet.inner.endpoint.bank.api.UserWithdrawInfoClientApi;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
|
||||
/**
|
||||
* 用户提现信息.
|
||||
*
|
||||
* @author tf
|
||||
*/
|
||||
@FeignClient(name = "userWithdrawInfoClient", url = "${feign.wallet.url}" +
|
||||
UserWithdrawInfoClientApi.API_PREFIX)
|
||||
public interface UserWithdrawInfoClient extends UserWithdrawInfoClientApi {
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.red.circle.wallet.inner.endpoint.bank.api;
|
||||
|
||||
import com.red.circle.framework.dto.PageResult;
|
||||
import com.red.circle.framework.dto.ResultResponse;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoBackQryCmd;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoCmd;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoPassCmd;
|
||||
import com.red.circle.wallet.inner.model.dto.UserWithdrawInfoDTO;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 用户提现信息.
|
||||
*
|
||||
* @author tf
|
||||
*/
|
||||
public interface UserWithdrawInfoClientApi {
|
||||
|
||||
String API_PREFIX = "/user-withdraw-info/client";
|
||||
|
||||
@PostMapping("/mapByIds")
|
||||
ResultResponse<Map<Long, UserWithdrawInfoDTO>> mapByIds(@RequestBody Set<Long> ids);
|
||||
|
||||
@GetMapping("/getById")
|
||||
ResultResponse<UserWithdrawInfoDTO> getById(@RequestParam("id") Long id);
|
||||
|
||||
@GetMapping("/existWithdrawInfo")
|
||||
ResultResponse<Boolean> existWithdrawInfo(@RequestParam("userId") Long userId,
|
||||
@RequestParam("category") String category);
|
||||
|
||||
@PostMapping("/addWithdrawInfo")
|
||||
ResultResponse<Void> addWithdrawInfo(@RequestBody UserWithdrawInfoCmd cmd);
|
||||
|
||||
@PostMapping("/updateWithdrawInfo")
|
||||
ResultResponse<Void> updateWithdrawInfo(@RequestBody UserWithdrawInfoCmd param);
|
||||
|
||||
@GetMapping("/listByUserId")
|
||||
ResultResponse<List<UserWithdrawInfoDTO>> listByUserId(@RequestParam("userId") Long userId);
|
||||
|
||||
@GetMapping("/listPassByUserId")
|
||||
ResultResponse<List<UserWithdrawInfoDTO>> listPassByUserId(@RequestParam("userId") Long userId);
|
||||
|
||||
@GetMapping("/useWithdrawInfo")
|
||||
ResultResponse<Void> useWithdrawInfo(@RequestParam("id") Long id,
|
||||
@RequestParam("userId") Long userId,
|
||||
@RequestParam("currentUidLong") Long currentUidLong);
|
||||
|
||||
@GetMapping("/deleteByIdByUserId")
|
||||
ResultResponse<Void> deleteByIdByUserId(@RequestParam("id") Long id,
|
||||
@RequestParam("userId") Long userId,
|
||||
@RequestParam("currentUidLong") Long currentUidLong);
|
||||
|
||||
@PostMapping("/pass")
|
||||
ResultResponse<Void> pass(@RequestBody UserWithdrawInfoPassCmd cmd);
|
||||
|
||||
@PostMapping("/notPass")
|
||||
ResultResponse<Void> notPass(@RequestBody UserWithdrawInfoPassCmd cmd);
|
||||
|
||||
@PostMapping("/pageQuery")
|
||||
ResultResponse<PageResult<UserWithdrawInfoDTO>> pageQuery(
|
||||
@RequestBody UserWithdrawInfoBackQryCmd dbQuery);
|
||||
|
||||
@PostMapping("/removeBatchByUserId")
|
||||
ResultResponse<Void> removeBatchByUserId(@RequestBody List<Long> userIds);
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.red.circle.wallet.inner.model.cmd;
|
||||
|
||||
import com.red.circle.common.business.dto.PageQueryCmd;
|
||||
import com.red.circle.framework.core.dto.PageCommand;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 用户提现信息后台查询命令.
|
||||
*
|
||||
* @author tf
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class UserWithdrawInfoBackQryCmd extends PageCommand {
|
||||
|
||||
/**
|
||||
* 系统来源.
|
||||
*/
|
||||
private String sysOrigin;
|
||||
|
||||
/**
|
||||
* 用户ID.
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 类别.
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 审核状态.
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
package com.red.circle.wallet.inner.model.cmd;
|
||||
|
||||
import com.red.circle.framework.core.dto.CommonCommand;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.io.Serial;
|
||||
import java.sql.Timestamp;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 用户提现信息.
|
||||
*
|
||||
* @author tf
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserWithdrawInfoCmd extends CommonCommand {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录id.
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 归属系统.
|
||||
*/
|
||||
private String sysOrigin;
|
||||
|
||||
/**
|
||||
* 用户id.
|
||||
*/
|
||||
@NotNull
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 联系电话.
|
||||
*/
|
||||
@NotBlank
|
||||
private String contactNumber;
|
||||
|
||||
/**
|
||||
* 类别.
|
||||
*/
|
||||
@NotBlank
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 其他描述.
|
||||
*/
|
||||
private String otherDescription;
|
||||
|
||||
/**
|
||||
* 护照/身份证正面照片URL.
|
||||
*/
|
||||
@NotBlank
|
||||
private String passportFrontUrl;
|
||||
|
||||
/**
|
||||
* 护照/身份证背面照片URL.
|
||||
*/
|
||||
@NotBlank
|
||||
private String passportBackUrl;
|
||||
|
||||
/**
|
||||
* 状态.
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 是否已删除(true是).
|
||||
*/
|
||||
private Boolean del;
|
||||
|
||||
/**
|
||||
* 创建时间.
|
||||
*/
|
||||
private Timestamp createTime;
|
||||
|
||||
/**
|
||||
* 修改时间.
|
||||
*/
|
||||
private Timestamp updateTime;
|
||||
|
||||
/**
|
||||
* 创建用户.
|
||||
*/
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 修改用户.
|
||||
*/
|
||||
private Long updateUser;
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.red.circle.wallet.inner.model.cmd;
|
||||
|
||||
import com.red.circle.framework.core.dto.CommonCommand;
|
||||
import java.io.Serial;
|
||||
import java.util.Set;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 用户提现信息审核命令.
|
||||
*
|
||||
* @author tf
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserWithdrawInfoPassCmd extends CommonCommand {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 提现信息ID集合.
|
||||
*/
|
||||
private Set<Long> ids;
|
||||
|
||||
/**
|
||||
* 当前操作用户ID.
|
||||
*/
|
||||
private Long currentUidLong;
|
||||
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
package com.red.circle.wallet.inner.model.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 用户提现信息DTO.
|
||||
*
|
||||
* @author tf
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class UserWithdrawInfoDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录id.
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id.
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 归属系统.
|
||||
*/
|
||||
private String sysOrigin;
|
||||
|
||||
/**
|
||||
* true正在使用.
|
||||
*/
|
||||
private Boolean use;
|
||||
|
||||
/**
|
||||
* 审核状态: 等待审核,已通过,不通过.
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 联系电话.
|
||||
*/
|
||||
private String contactNumber;
|
||||
|
||||
/**
|
||||
* 类别.
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 其他描述.
|
||||
*/
|
||||
private String otherDescription;
|
||||
|
||||
/**
|
||||
* 护照/身份证正面照片URL.
|
||||
*/
|
||||
private String passportFrontUrl;
|
||||
|
||||
/**
|
||||
* 护照/身份证背面照片URL.
|
||||
*/
|
||||
private String passportBackUrl;
|
||||
|
||||
/**
|
||||
* 是否已删除(true是).
|
||||
*/
|
||||
private Boolean del;
|
||||
|
||||
/**
|
||||
* 创建时间.
|
||||
*/
|
||||
private Timestamp createTime;
|
||||
|
||||
/**
|
||||
* 修改时间.
|
||||
*/
|
||||
private Timestamp updateTime;
|
||||
|
||||
/**
|
||||
* 创建用户.
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 修改用户.
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long updateUser;
|
||||
|
||||
}
|
||||
@ -0,0 +1,113 @@
|
||||
package com.red.circle.console.adapter.app.user;
|
||||
|
||||
import com.red.circle.console.app.dto.clienobject.user.UserWithdrawInfoCO;
|
||||
import com.red.circle.console.app.service.app.user.UserWithdrawInfoBackService;
|
||||
import com.red.circle.framework.dto.PageResult;
|
||||
import com.red.circle.framework.web.controller.BaseController;
|
||||
import com.red.circle.tool.core.date.TimestampUtils;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoBackQryCmd;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoCmd;
|
||||
import com.red.circle.wallet.inner.model.dto.UserWithdrawInfoDTO;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户提现信息 前端控制器.
|
||||
* </p>
|
||||
*
|
||||
* @author tf
|
||||
* @since 2025-01-09
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/user/withdraw-info")
|
||||
public class UserWithdrawInfoRestController extends BaseController {
|
||||
|
||||
private final UserWithdrawInfoBackService userWithdrawInfoBackService;
|
||||
|
||||
/**
|
||||
* 列表查询.
|
||||
*/
|
||||
@GetMapping("/list/user-id/{id}")
|
||||
public List<UserWithdrawInfoCO> listByUserId(@PathVariable("id") Long id) {
|
||||
return userWithdrawInfoBackService.listByUserId(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过的提现信息列表.
|
||||
*/
|
||||
@GetMapping("/pass-list")
|
||||
public List<UserWithdrawInfoDTO> listPassWithdrawInfo(Long userId) {
|
||||
return userWithdrawInfoBackService.listPassWithdrawInfo(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户提现信息分页.
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public PageResult<UserWithdrawInfoCO> pageQuery(UserWithdrawInfoBackQryCmd query) {
|
||||
return userWithdrawInfoBackService.pageQuery(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户提现信息.
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
public void update(@RequestBody @Validated UserWithdrawInfoCmd param) {
|
||||
param.setUpdateUser(param.getReqUserId());
|
||||
param.setUpdateTime(TimestampUtils.now());
|
||||
userWithdrawInfoBackService.update(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户提现信息.
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public void add(@RequestBody @Validated UserWithdrawInfoCmd param) {
|
||||
param.setCreateUser(param.getReqUserId());
|
||||
param.setCreateTime(TimestampUtils.now());
|
||||
userWithdrawInfoBackService.add(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核驳回用户提现信息.
|
||||
*/
|
||||
@PostMapping("/not-pass")
|
||||
public void notPass(@RequestBody Set<Long> ids) {
|
||||
userWithdrawInfoBackService.notPass(ids, getReqUserId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核通过用户提现信息.
|
||||
*/
|
||||
@PostMapping("/pass")
|
||||
public void pass(@RequestBody Set<Long> ids) {
|
||||
userWithdrawInfoBackService.pass(ids, getReqUserId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据提现信息id删除用户提现信息.
|
||||
*/
|
||||
@GetMapping("/delete/{id}")
|
||||
public void deleteById(@PathVariable("id") Long id) {
|
||||
userWithdrawInfoBackService.deleteById(id, getReqUserId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换使用中的提现信息.
|
||||
*/
|
||||
@GetMapping("/use/{id}")
|
||||
public void use(@PathVariable("id") Long id) {
|
||||
userWithdrawInfoBackService.use(id, getReqUserId());
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,136 @@
|
||||
package com.red.circle.console.app.service.app.user;
|
||||
|
||||
import com.red.circle.common.business.core.enums.ApprovalStatusEnum;
|
||||
import com.red.circle.console.app.convertor.bank.BankAppConvertor;
|
||||
import com.red.circle.console.app.dto.clienobject.user.UserWithdrawInfoCO;
|
||||
import com.red.circle.console.inner.error.ConsoleErrorCode;
|
||||
import com.red.circle.framework.core.asserts.ResponseAssert;
|
||||
import com.red.circle.framework.dto.PageResult;
|
||||
import com.red.circle.other.inner.endpoint.user.user.UserProfileClient;
|
||||
import com.red.circle.other.inner.model.dto.user.UserProfileDTO;
|
||||
import com.red.circle.tool.core.collection.CollectionUtils;
|
||||
import com.red.circle.tool.core.sequence.IdWorkerUtils;
|
||||
import com.red.circle.wallet.inner.endpoint.bank.UserWithdrawInfoClient;
|
||||
import com.red.circle.wallet.inner.error.BankErrorCode;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoBackQryCmd;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoCmd;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoPassCmd;
|
||||
import com.red.circle.wallet.inner.model.dto.UserWithdrawInfoDTO;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 用户提现信息.
|
||||
*
|
||||
* @author tf
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class UserWithdrawInfoBackServiceImpl implements UserWithdrawInfoBackService {
|
||||
|
||||
private final UserWithdrawInfoClient withdrawInfoClient;
|
||||
private final BankAppConvertor bankAppConvertor;
|
||||
private final UserProfileClient userProfileClient;
|
||||
|
||||
@Override
|
||||
public void add(UserWithdrawInfoCmd param) {
|
||||
ResponseAssert.isFalse(BankErrorCode.REPEAT_WITHDRAW_INFO_ERROR,
|
||||
ResponseAssert.requiredSuccess(
|
||||
withdrawInfoClient.existWithdrawInfo(param.getUserId(), param.getCategory())));
|
||||
|
||||
param.setId(IdWorkerUtils.getId());
|
||||
param.setDel(Boolean.FALSE);
|
||||
param.setStatus(ApprovalStatusEnum.PASS.name());
|
||||
param.setSysOrigin(param.getSysOrigin());
|
||||
withdrawInfoClient.addWithdrawInfo(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(UserWithdrawInfoCmd param) {
|
||||
withdrawInfoClient.updateWithdrawInfo(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserWithdrawInfoCO> listByUserId(Long userId) {
|
||||
return bankAppConvertor.toListUserWithdrawInfoCO(
|
||||
ResponseAssert.requiredSuccess(withdrawInfoClient.listByUserId(userId)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserWithdrawInfoDTO> listPassWithdrawInfo(Long userId) {
|
||||
return ResponseAssert.requiredSuccess(withdrawInfoClient.listPassByUserId(userId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void use(Long id, Long currentUidLong) {
|
||||
UserWithdrawInfoDTO withdrawInfo = ResponseAssert.requiredSuccess(
|
||||
withdrawInfoClient.getById(id));
|
||||
ResponseAssert.notNull(ConsoleErrorCode.NOT_FOUND_RECORD, withdrawInfo);
|
||||
ResponseAssert.isFalse(ConsoleErrorCode.NOT_FOUND_RECORD, withdrawInfo.getDel());
|
||||
ResponseAssert.isTrue(BankErrorCode.NOT_APPROVED_ERROR,
|
||||
Objects.equals(ApprovalStatusEnum.PASS.name(), withdrawInfo.getStatus()));
|
||||
ResponseAssert.requiredSuccess(
|
||||
withdrawInfoClient.useWithdrawInfo(id, withdrawInfo.getUserId(), currentUidLong));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteById(Long id, Long currentUidLong) {
|
||||
UserWithdrawInfoDTO withdrawInfo = ResponseAssert.requiredSuccess(
|
||||
withdrawInfoClient.getById(id));
|
||||
ResponseAssert.notNull(ConsoleErrorCode.NOT_FOUND_RECORD, withdrawInfo);
|
||||
ResponseAssert.isFalse(ConsoleErrorCode.NOT_FOUND_RECORD, withdrawInfo.getDel());
|
||||
withdrawInfoClient.deleteByIdByUserId(id, withdrawInfo.getUserId(), currentUidLong);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pass(Set<Long> ids, Long currentUidLong) {
|
||||
withdrawInfoClient.pass(
|
||||
new UserWithdrawInfoPassCmd().setCurrentUidLong(currentUidLong).setIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notPass(Set<Long> ids, Long currentUidLong) {
|
||||
withdrawInfoClient.notPass(
|
||||
new UserWithdrawInfoPassCmd().setCurrentUidLong(currentUidLong).setIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<UserWithdrawInfoCO> pageQuery(UserWithdrawInfoBackQryCmd query) {
|
||||
PageResult<UserWithdrawInfoDTO> withdrawInfoDTOPageResult = ResponseAssert.requiredSuccess(
|
||||
withdrawInfoClient.pageQuery(query));
|
||||
PageResult<UserWithdrawInfoCO> pageResult = withdrawInfoDTOPageResult.convert(
|
||||
bankAppConvertor::toUserWithdrawInfoCO);
|
||||
|
||||
if (pageResult.getTotal() <= 0) {
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
Map<Long, UserProfileDTO> userProfileMap = getUserProfileMap(
|
||||
pageResult.getRecords().stream().toList());
|
||||
if (CollectionUtils.isEmpty(userProfileMap)) {
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
pageResult.setRecords(pageResult.getRecords().stream().map(info -> {
|
||||
UserProfileDTO userProfile = userProfileMap.get(info.getUserId());
|
||||
if (Objects.isNull(userProfile)) {
|
||||
return null;
|
||||
}
|
||||
info.setUserProfile(userProfile);
|
||||
return info;
|
||||
}).filter(Objects::nonNull).collect(Collectors.toList()));
|
||||
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
private Map<Long, UserProfileDTO> getUserProfileMap(List<UserWithdrawInfoCO> withdrawInfos) {
|
||||
return ResponseAssert.requiredSuccess(userProfileClient.mapByUserIds(
|
||||
withdrawInfos.stream().map(UserWithdrawInfoCO::getUserId).collect(Collectors.toSet())));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,108 @@
|
||||
package com.red.circle.console.app.dto.clienobject.user;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.red.circle.other.inner.model.dto.user.UserProfileDTO;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 用户提现信息.
|
||||
*
|
||||
* @author tf
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class UserWithdrawInfoCO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录id.
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 归属系统.
|
||||
*/
|
||||
private String sysOrigin;
|
||||
|
||||
/**
|
||||
* 用户id.
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户.
|
||||
*/
|
||||
private UserProfileDTO userProfile;
|
||||
|
||||
/**
|
||||
* true正在使用.
|
||||
*/
|
||||
private Boolean use;
|
||||
|
||||
/**
|
||||
* 审核状态: 等待审核,已通过,不通过.
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 联系电话.
|
||||
*/
|
||||
private String contactNumber;
|
||||
|
||||
/**
|
||||
* 类别.
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 其他描述.
|
||||
*/
|
||||
private String otherDescription;
|
||||
|
||||
/**
|
||||
* 护照/身份证正面照片URL.
|
||||
*/
|
||||
private String passportFrontUrl;
|
||||
|
||||
/**
|
||||
* 护照/身份证背面照片URL.
|
||||
*/
|
||||
private String passportBackUrl;
|
||||
|
||||
/**
|
||||
* 是否已删除(true是).
|
||||
*/
|
||||
private Boolean del;
|
||||
|
||||
/**
|
||||
* 创建时间.
|
||||
*/
|
||||
private Timestamp createTime;
|
||||
|
||||
/**
|
||||
* 修改时间.
|
||||
*/
|
||||
private Timestamp updateTime;
|
||||
|
||||
/**
|
||||
* 创建用户.
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 修改用户.
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long updateUser;
|
||||
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package com.red.circle.console.app.service.app.user;
|
||||
|
||||
import com.red.circle.console.app.dto.clienobject.user.UserWithdrawInfoCO;
|
||||
import com.red.circle.framework.dto.PageResult;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoBackQryCmd;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoCmd;
|
||||
import com.red.circle.wallet.inner.model.dto.UserWithdrawInfoDTO;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 用户提现信息.
|
||||
*
|
||||
* @author tf
|
||||
*/
|
||||
public interface UserWithdrawInfoBackService {
|
||||
|
||||
/**
|
||||
* 添加.
|
||||
*/
|
||||
void add(UserWithdrawInfoCmd param);
|
||||
|
||||
/**
|
||||
* 修改.
|
||||
*/
|
||||
void update(UserWithdrawInfoCmd param);
|
||||
|
||||
/**
|
||||
* 根据用户id获得提现信息列表.
|
||||
*
|
||||
* @param userId 用户id.
|
||||
*/
|
||||
List<UserWithdrawInfoCO> listByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 获取用户通过的提现信息列表.
|
||||
*/
|
||||
List<UserWithdrawInfoDTO> listPassWithdrawInfo(Long userId);
|
||||
|
||||
/**
|
||||
* 将提现信息设置为使用状态.
|
||||
*
|
||||
* @param id id.
|
||||
*/
|
||||
void use(Long id, Long currentUidLong);
|
||||
|
||||
/**
|
||||
* 删除提现信息.
|
||||
*
|
||||
* @param id id.
|
||||
*/
|
||||
void deleteById(Long id, Long currentUidLong);
|
||||
|
||||
/**
|
||||
* 通过审核.
|
||||
*
|
||||
* @param ids ids.
|
||||
*/
|
||||
void pass(Set<Long> ids, Long currentUidLong);
|
||||
|
||||
/**
|
||||
* 驳回.
|
||||
*
|
||||
* @param ids ids.
|
||||
*/
|
||||
void notPass(Set<Long> ids, Long currentUidLong);
|
||||
|
||||
/**
|
||||
* 提现信息列表分页.
|
||||
*/
|
||||
PageResult<UserWithdrawInfoCO> pageQuery(UserWithdrawInfoBackQryCmd query);
|
||||
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
package com.red.circle.wallet.inner.endpoint.bank;
|
||||
|
||||
import com.red.circle.framework.dto.PageResult;
|
||||
import com.red.circle.framework.dto.ResultResponse;
|
||||
import com.red.circle.wallet.inner.endpoint.bank.api.UserWithdrawInfoClientApi;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoBackQryCmd;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoCmd;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoPassCmd;
|
||||
import com.red.circle.wallet.inner.model.dto.UserWithdrawInfoDTO;
|
||||
import com.red.circle.wallet.inner.service.bank.UserWithdrawInfoClientService;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 用户提现信息.
|
||||
*
|
||||
* @author tf
|
||||
*/
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping(value = UserWithdrawInfoClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@RequiredArgsConstructor
|
||||
public class UserWithdrawInfoClientEndpoint implements UserWithdrawInfoClientApi {
|
||||
|
||||
private final UserWithdrawInfoClientService userWithdrawInfoClientService;
|
||||
|
||||
@Override
|
||||
public ResultResponse<Map<Long, UserWithdrawInfoDTO>> mapByIds(Set<Long> ids) {
|
||||
return ResultResponse.success(userWithdrawInfoClientService.mapByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultResponse<UserWithdrawInfoDTO> getById(Long id) {
|
||||
return ResultResponse.success(userWithdrawInfoClientService.getById(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultResponse<Boolean> existWithdrawInfo(Long userId, String category) {
|
||||
return ResultResponse.success(
|
||||
userWithdrawInfoClientService.existWithdrawInfo(userId, category));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultResponse<Void> addWithdrawInfo(UserWithdrawInfoCmd cmd) {
|
||||
userWithdrawInfoClientService.addWithdrawInfo(cmd);
|
||||
return ResultResponse.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultResponse<Void> updateWithdrawInfo(UserWithdrawInfoCmd param) {
|
||||
userWithdrawInfoClientService.updateWithdrawInfo(param);
|
||||
return ResultResponse.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultResponse<List<UserWithdrawInfoDTO>> listByUserId(Long userId) {
|
||||
return ResultResponse.success(userWithdrawInfoClientService.listByUserId(userId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultResponse<List<UserWithdrawInfoDTO>> listPassByUserId(Long userId) {
|
||||
return ResultResponse.success(userWithdrawInfoClientService.listPassByUserId(userId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultResponse<Void> useWithdrawInfo(Long id, Long userId, Long currentUidLong) {
|
||||
userWithdrawInfoClientService.useWithdrawInfo(id, userId, currentUidLong);
|
||||
return ResultResponse.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultResponse<Void> deleteByIdByUserId(Long id, Long userId, Long currentUidLong) {
|
||||
userWithdrawInfoClientService.deleteByIdByUserId(id, userId, currentUidLong);
|
||||
return ResultResponse.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultResponse<Void> pass(UserWithdrawInfoPassCmd cmd) {
|
||||
userWithdrawInfoClientService.pass(cmd.getIds(), cmd.getCurrentUidLong());
|
||||
return ResultResponse.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultResponse<Void> notPass(UserWithdrawInfoPassCmd cmd) {
|
||||
userWithdrawInfoClientService.notPass(cmd.getIds(), cmd.getCurrentUidLong());
|
||||
return ResultResponse.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultResponse<PageResult<UserWithdrawInfoDTO>> pageQuery(
|
||||
UserWithdrawInfoBackQryCmd dbQuery) {
|
||||
return ResultResponse.success(userWithdrawInfoClientService.pageQuery(dbQuery));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultResponse<Void> removeBatchByUserId(List<Long> userIds) {
|
||||
userWithdrawInfoClientService.removeBatchByUserId(userIds);
|
||||
return ResultResponse.success();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.red.circle.wallet.inner.service.bank;
|
||||
|
||||
import com.red.circle.framework.dto.PageResult;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoBackQryCmd;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoCmd;
|
||||
import com.red.circle.wallet.inner.model.dto.UserWithdrawInfoDTO;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 用户提现信息.
|
||||
*
|
||||
* @author tf
|
||||
*/
|
||||
public interface UserWithdrawInfoClientService {
|
||||
|
||||
Map<Long, UserWithdrawInfoDTO> mapByIds(Set<Long> ids);
|
||||
|
||||
UserWithdrawInfoDTO getById(Long id);
|
||||
|
||||
Boolean existWithdrawInfo(Long userId, String category);
|
||||
|
||||
void addWithdrawInfo(UserWithdrawInfoCmd cmd);
|
||||
|
||||
void updateWithdrawInfo(UserWithdrawInfoCmd param);
|
||||
|
||||
List<UserWithdrawInfoDTO> listByUserId(Long userId);
|
||||
|
||||
List<UserWithdrawInfoDTO> listPassByUserId(Long userId);
|
||||
|
||||
void useWithdrawInfo(Long id, Long userId, Long currentUidLong);
|
||||
|
||||
void deleteByIdByUserId(Long id, Long userId, Long currentUidLong);
|
||||
|
||||
void pass(Set<Long> ids, Long currentUidLong);
|
||||
|
||||
void notPass(Set<Long> ids, Long currentUidLong);
|
||||
|
||||
PageResult<UserWithdrawInfoDTO> pageQuery(UserWithdrawInfoBackQryCmd dbQuery);
|
||||
|
||||
void removeBatchByUserId(List<Long> userIds);
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.red.circle.wallet.inner.service.bank.impl;
|
||||
|
||||
import com.red.circle.framework.dto.PageResult;
|
||||
import com.red.circle.wallet.infra.database.mongo.entity.bank.UserWithdrawInfo;
|
||||
import com.red.circle.wallet.infra.database.mongo.service.bank.UserWithdrawInfoService;
|
||||
import com.red.circle.wallet.inner.convertor.UserBankInnerConvertor;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoBackQryCmd;
|
||||
import com.red.circle.wallet.inner.model.cmd.UserWithdrawInfoCmd;
|
||||
import com.red.circle.wallet.inner.model.dto.UserWithdrawInfoDTO;
|
||||
import com.red.circle.wallet.inner.service.bank.UserWithdrawInfoClientService;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 用户提现信息.
|
||||
*
|
||||
* @author tf
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class UserWithdrawInfoClientServiceImpl implements UserWithdrawInfoClientService {
|
||||
|
||||
private final UserWithdrawInfoService userWithdrawInfoService;
|
||||
private final UserBankInnerConvertor userBankInnerConvertor;
|
||||
|
||||
@Override
|
||||
public Map<Long, UserWithdrawInfoDTO> mapByIds(Set<Long> ids) {
|
||||
return userBankInnerConvertor.toMapUserWithdrawInfoDTO(
|
||||
userWithdrawInfoService.mapByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserWithdrawInfoDTO getById(Long id) {
|
||||
return userBankInnerConvertor.toUserWithdrawInfoDTO(userWithdrawInfoService.getById(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean existWithdrawInfo(Long userId, String category) {
|
||||
return userWithdrawInfoService.exist(userId, category);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addWithdrawInfo(UserWithdrawInfoCmd cmd) {
|
||||
userWithdrawInfoService.add(userBankInnerConvertor.toUserWithdrawInfo(cmd));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateWithdrawInfo(UserWithdrawInfoCmd param) {
|
||||
userWithdrawInfoService.update(userBankInnerConvertor.toUserWithdrawInfo(param));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserWithdrawInfoDTO> listByUserId(Long userId) {
|
||||
return userBankInnerConvertor.toListUserWithdrawInfoDTO(
|
||||
userWithdrawInfoService.listByUserId(userId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserWithdrawInfoDTO> listPassByUserId(Long userId) {
|
||||
return userBankInnerConvertor.toListUserWithdrawInfoDTO(
|
||||
userWithdrawInfoService.listPassByUserId(userId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void useWithdrawInfo(Long id, Long userId, Long currentUidLong) {
|
||||
userWithdrawInfoService.use(id, userId, currentUidLong);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByIdByUserId(Long id, Long userId, Long currentUidLong) {
|
||||
userWithdrawInfoService.deleteByIdByUserId(id, userId, currentUidLong);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pass(Set<Long> ids, Long currentUidLong) {
|
||||
userWithdrawInfoService.pass(ids, currentUidLong);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notPass(Set<Long> ids, Long currentUidLong) {
|
||||
userWithdrawInfoService.notPass(ids, currentUidLong);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<UserWithdrawInfoDTO> pageQuery(UserWithdrawInfoBackQryCmd dbQuery) {
|
||||
PageResult<UserWithdrawInfo> pageResult = userWithdrawInfoService.pageQuery(dbQuery);
|
||||
return pageResult.convert(userBankInnerConvertor::toUserWithdrawInfoDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBatchByUserId(List<Long> userIds) {
|
||||
userWithdrawInfoService.removeBatchByUserId(userIds);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user