feat:后台功能
This commit is contained in:
1 parent
71473ade25
commit
7d74e96a94
27 files changed
+308
-60
No files matched your search
+20
@@ -0,0 +1,20 @@
|
||||
package cn.iocoder.yudao.module.trade.api.brokerage;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 分销 API 接口
|
||||
*/
|
||||
public interface TradeBrokerageUserApi {
|
||||
|
||||
/**
|
||||
* 绑定分销员
|
||||
*/
|
||||
boolean bindBrokerageUser(@NotNull Long userId, @NotNull Long bindUserId);
|
||||
|
||||
/**
|
||||
* 绑定分销员
|
||||
*/
|
||||
boolean bindBrokerageUser(@NotNull Long userId, @NotNull String brokerageCode);
|
||||
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.trade.api.brokerage;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.module.trade.dal.dataobject.brokerage.BrokerageCodeDO;
|
||||
import cn.iocoder.yudao.module.trade.service.brokerage.BrokerageCodeService;
|
||||
import cn.iocoder.yudao.module.trade.service.brokerage.BrokerageUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class TradeBrokerageUserApiImpl implements TradeBrokerageUserApi {
|
||||
|
||||
@Resource
|
||||
private BrokerageUserService brokerageUserService;
|
||||
@Resource
|
||||
private BrokerageCodeService brokerageCodeService;
|
||||
|
||||
@Override
|
||||
public boolean bindBrokerageUser(@NotNull Long userId, @NotNull Long bindUserId) {
|
||||
return brokerageUserService.bindBrokerageUser(userId, bindUserId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean bindBrokerageUser(@NotNull Long userId, @NotNull String brokerageCode) {
|
||||
// 查询推广码
|
||||
BrokerageCodeDO brokerageCodeDO = brokerageCodeService.getByCode(brokerageCode);
|
||||
if (ObjectUtil.isEmpty(brokerageCodeDO)) return false;
|
||||
if (ObjectUtil.equals(brokerageCodeDO.getMemberId(), userId)) return false;
|
||||
return brokerageUserService.bindBrokerageUser(userId, brokerageCodeDO.getMemberId());
|
||||
}
|
||||
}
|
||||
+3
@@ -32,6 +32,9 @@ public interface BrokerageCodeService {
|
||||
*/
|
||||
BrokerageCodeDO getBrokerageCode(Long id);
|
||||
|
||||
BrokerageCodeDO getByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 获得分销码分页
|
||||
*/
|
||||
|
||||
+8
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.trade.service.brokerage;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
||||
import cn.iocoder.yudao.module.trade.controller.admin.brokerage.vo.code.BrokerageCodePageReqVO;
|
||||
import cn.iocoder.yudao.module.trade.controller.admin.brokerage.vo.code.BrokerageCodeSaveReqVO;
|
||||
@@ -79,6 +80,13 @@ public class BrokerageCodeServiceImpl implements BrokerageCodeService {
|
||||
return brokerageCodeMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BrokerageCodeDO getByCode(String code) {
|
||||
return brokerageCodeMapper.selectOne(new LambdaQueryWrapperX<BrokerageCodeDO>()
|
||||
.eq(BrokerageCodeDO::getCode, code)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<BrokerageCodeDO> getBrokerageCodePage(BrokerageCodePageReqVO pageReqVO) {
|
||||
return brokerageCodeMapper.selectPage(pageReqVO);
|
||||
|
||||
+4
-2
@@ -18,14 +18,16 @@ public enum MemberRecentSceneEnum {
|
||||
SQUARE_SQUARE("3", "广场-广场"),
|
||||
SQUARE_NEW_TIME("4", "广场-最近"),
|
||||
SQUARE_NEW_PERSON("5", "广场-新人"),
|
||||
USER("6", "查询用户朋友圈"),
|
||||
SQUARE_VIP_MALE("6", "广场-VIP男士"),
|
||||
SQUARE_FEMALE("7", "广场-女生"),
|
||||
USER("100", "查询用户朋友圈"),
|
||||
;
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static List<MemberRecentSceneEnum> dynamicList = Arrays.asList(DYNAMIC_RECOMMEND, DYNAMIC_NEARBY);
|
||||
|
||||
public static List<MemberRecentSceneEnum> squareList = Arrays.asList(SQUARE_SQUARE, SQUARE_NEW_TIME, SQUARE_NEW_PERSON);
|
||||
public static List<MemberRecentSceneEnum> squareList = Arrays.asList(SQUARE_SQUARE, SQUARE_NEW_TIME, SQUARE_NEW_PERSON, SQUARE_VIP_MALE, SQUARE_FEMALE);
|
||||
|
||||
public static List<MemberRecentSceneEnum> distanceSceneList = Arrays.asList(DYNAMIC_NEARBY, SQUARE_NEW_TIME);
|
||||
|
||||
|
||||
@@ -33,6 +33,11 @@
|
||||
<artifactId>yudao-module-infra-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-trade-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
|
||||
+3
@@ -70,6 +70,9 @@ public class RecentPageReqVO extends PageParam {
|
||||
@Schema(description = "距离不为空")
|
||||
private Boolean distanceIsNotNull;
|
||||
|
||||
@Schema(description = "是否是VIP")
|
||||
private Boolean isVip;
|
||||
|
||||
/**
|
||||
* 用户tag相关
|
||||
*/
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.viewrecord;
|
||||
|
||||
import cn.iocoder.yudao.module.member.controller.admin.recent.vo.OperationRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.recent.vo.AppRecentViewRecordReqVo;
|
||||
import cn.iocoder.yudao.module.member.service.recent.ViewRecordService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -72,8 +73,8 @@ public class ViewRecordController {
|
||||
@Operation(summary = "获得用户查看记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:view-record:query')")
|
||||
public CommonResult<PageResult<ViewRecordPageRespVO>> getViewRecordPage(@Valid ViewRecordPageRespVO pageReqVO) {
|
||||
PageResult<ViewRecordDO> pageResult = viewRecordService.getViewRecordPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ViewRecordPageRespVO.class));
|
||||
PageResult<ViewRecordPageRespVO> pageResult = viewRecordService.getViewRecordPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
}
|
||||
+8
@@ -1,10 +1,14 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.viewrecord.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.member.service.user.BO.MemberExtBO;
|
||||
import cn.iocoder.yudao.module.member.service.user.BO.MemberTagExtBO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户查看记录 Response VO")
|
||||
@@ -48,4 +52,8 @@ public class ViewRecordPageRespVO extends PageParam {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private MemberExtBO member;
|
||||
|
||||
private List<MemberTagExtBO> memberTagList;
|
||||
|
||||
}
|
||||
+3
@@ -39,6 +39,9 @@ public class AppMemberUserUpdateReqVO {
|
||||
@Schema(description = "个人介绍")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "邀请码")
|
||||
private String invitationCode;
|
||||
|
||||
@Schema(description = "用户相册")
|
||||
private List<UploadReqVo> photo;
|
||||
|
||||
|
||||
+34
-9
@@ -1,10 +1,13 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.view;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserInfoRespVO;
|
||||
import cn.iocoder.yudao.module.member.convert.user.MemberUserConvert;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
||||
import cn.iocoder.yudao.module.system.enums.common.SexEnum;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -13,12 +16,11 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
|
||||
|
||||
@Tag(name = "用户 APP - 页面相关")
|
||||
@RestController
|
||||
@@ -27,6 +29,9 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
@Slf4j
|
||||
public class AppViewController {
|
||||
|
||||
@Resource
|
||||
private MemberUserService memberUserService;
|
||||
|
||||
@GetMapping("/get-dynamic-classify")
|
||||
@Operation(summary = "获取动态菜单")
|
||||
public CommonResult<List<Map<String, String>>> getDynamicClassify() {
|
||||
@@ -47,6 +52,10 @@ public class AppViewController {
|
||||
@GetMapping("/get-square-classify")
|
||||
@Operation(summary = "获取广场菜单")
|
||||
public CommonResult<List<Map<String, String>>> getSquareClassify() {
|
||||
// 查询用户
|
||||
MemberUserDO currentUser = memberUserService.getUser(getLoginUserId());
|
||||
if (ObjectUtil.isEmpty(currentUser)) return success(Collections.emptyList());
|
||||
|
||||
List<Map<String, String>> menu = new ArrayList<>();
|
||||
menu.add(new HashMap<String, String>() {{
|
||||
put("code", "1000");
|
||||
@@ -58,11 +67,27 @@ public class AppViewController {
|
||||
put("search-action", "SQUARE_NEW_TIME");
|
||||
put("label", "最近");
|
||||
}});
|
||||
menu.add(new HashMap<String, String>() {{
|
||||
put("code", "3000");
|
||||
put("search-action", "SQUARE_NEW_PERSON");
|
||||
put("label", "新人");
|
||||
}});
|
||||
// 男生
|
||||
if (SexEnum.isMale(currentUser.getSex())) {
|
||||
menu.add(new HashMap<String, String>() {{
|
||||
put("code", "3000");
|
||||
put("search-action", "SQUARE_NEW_PERSON");
|
||||
put("label", "新人");
|
||||
}});
|
||||
}
|
||||
// 女生
|
||||
if (SexEnum.isFemale(currentUser.getSex())) {
|
||||
menu.add(new HashMap<String, String>() {{
|
||||
put("code", "4000");
|
||||
put("search-action", "SQUARE_VIP_MALE");
|
||||
put("label", "VIP男士");
|
||||
}});
|
||||
menu.add(new HashMap<String, String>() {{
|
||||
put("code", "5000");
|
||||
put("search-action", "SQUARE_FEMALE");
|
||||
put("label", "女生");
|
||||
}});
|
||||
}
|
||||
return success(menu);
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -31,6 +31,7 @@ public interface OperationMapper extends BaseMapperX<OperationDO> {
|
||||
.likeIfExists("operator_member", MemberUserDO::getNickname, reqVO.getOperatorMemberNickname())
|
||||
.eqIfExists(OperationDO::getMemberRecentId, reqVO.getMemberRecentId())
|
||||
.eqIfExists(OperationDO::getMemberId, reqVO.getMemberId())
|
||||
.eqIfExists(OperationDO::getOperatorMemberId, reqVO.getOperatorMemberId())
|
||||
.eqIfExists(OperationDO::getBizType, reqVO.getBizType())
|
||||
.eqIfExists(OperationDO::getReportType, reqVO.getReportType());
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getCreateTime())) {
|
||||
|
||||
+9
-1
@@ -286,9 +286,17 @@ public class ComAuthServiceImpl implements ComAuthService {
|
||||
// 查询当前用户
|
||||
MemberUserDO user = memberUserService.getUser(userId);
|
||||
if (ObjectUtil.isEmpty(user)) throw exception(MemberErrorCode.USER_NOT_EXISTS);
|
||||
List<String> excludeAuthStatus = Arrays.asList(
|
||||
MemberComAuthStatusEnum.CHECK_FAIL.getType()
|
||||
);
|
||||
List<String> includeBizTypeList = Arrays.asList(
|
||||
MemberComAuthEnum.MAN_MEMBER_TRUE.getType(),
|
||||
MemberComAuthEnum.WOMAN_MEMBER_TRUE.getType()
|
||||
);
|
||||
return authMapper.selectOne(new LambdaQueryWrapperX<ComAuthDO>()
|
||||
.eq(ComAuthDO::getAuthMemberId, userId)
|
||||
.ne(ComAuthDO::getAuthStatus, MemberComAuthStatusEnum.WAIT_AUTH.getType())
|
||||
.in(ComAuthDO::getBizType, includeBizTypeList)
|
||||
.notIn(ComAuthDO::getAuthStatus, excludeAuthStatus)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+45
-15
@@ -14,6 +14,7 @@ import cn.iocoder.yudao.module.member.controller.app.recent.vo.AppRecentQuickPag
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.location.LocationDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.photo.PhotoDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.recent.OperationDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberRecentCfgDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.recent.OperationMapper;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.user.MemberRecentTagMapper;
|
||||
@@ -27,6 +28,7 @@ import cn.iocoder.yudao.module.member.client.service.ThirdAuthService;
|
||||
import cn.iocoder.yudao.module.member.service.photo.PhotoService;
|
||||
import cn.iocoder.yudao.module.member.service.user.BO.MemberExtBO;
|
||||
import cn.iocoder.yudao.module.member.service.user.BO.MemberTagExtBO;
|
||||
import cn.iocoder.yudao.module.member.service.user.MemberRecentCfgService;
|
||||
import cn.iocoder.yudao.module.member.service.user.MemberRecentTagService;
|
||||
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
||||
import cn.iocoder.yudao.module.system.enums.common.SexEnum;
|
||||
@@ -35,6 +37,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -85,6 +88,8 @@ public class RecentServiceImpl implements RecentService {
|
||||
private OperationService operationService;
|
||||
@Resource
|
||||
private MemberRecentTagService memberRecentTagService;
|
||||
@Resource
|
||||
private MemberRecentCfgService memberRecentCfgService;
|
||||
|
||||
/**
|
||||
* 创建朋友圈
|
||||
@@ -177,15 +182,17 @@ public class RecentServiceImpl implements RecentService {
|
||||
if (ObjectUtil.isNotEmpty(dto.getMemberRecentId())) {
|
||||
validateRecentExists(dto.getMemberRecentId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getMemberId()) && ObjectUtil.isNotEmpty(dto.getOperatorMemberId())) {
|
||||
if (ObjectUtil.equals(dto.getMemberId(), dto.getOperatorMemberId())) {
|
||||
throw exception(MemberErrorCode.EMPTY, "不能对自己进行操作");
|
||||
}
|
||||
}
|
||||
List<MemberRecentOperateEnum> likeActionList = Arrays.asList(MemberRecentOperateEnum.MEMBER_COLLECT, MemberRecentOperateEnum.RECENT_LIKE);
|
||||
OperationDO operationDO = operationMapper.selectOne(new LambdaQueryWrapperX<OperationDO>()
|
||||
.eq(OperationDO::getMemberId, dto.getMemberId())
|
||||
.eq(OperationDO::getOperatorMemberId, dto.getOperatorMemberId())
|
||||
.eq(OperationDO::getBizType, dto.getAction().getType())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getMemberRecentId()), OperationDO::getMemberRecentId, dto.getMemberRecentId())
|
||||
.in(OperationDO::getBizType, Arrays.asList(
|
||||
MemberRecentOperateEnum.MEMBER_COLLECT.getType(),
|
||||
MemberRecentOperateEnum.RECENT_LIKE.getType()
|
||||
))
|
||||
);
|
||||
if (likeActionList.contains(dto.getAction())) {
|
||||
if (ObjectUtil.isNotEmpty(operationDO)) {
|
||||
@@ -221,7 +228,7 @@ public class RecentServiceImpl implements RecentService {
|
||||
// 屏蔽/拉黑
|
||||
if (ObjectUtil.equals(dto.getAction(), MemberRecentOperateEnum.MEMBER_SHIELD)) {
|
||||
if (ObjectUtil.isNotEmpty(operationDO)) {
|
||||
throw exception(MemberErrorCode.EMPTY, "已屏蔽,无需重复操作");
|
||||
throw exception(MemberErrorCode.EMPTY, "已拉黑,无需重复操作");
|
||||
}
|
||||
}
|
||||
// 举报
|
||||
@@ -281,10 +288,11 @@ public class RecentServiceImpl implements RecentService {
|
||||
public PageResult<RecentPageResVo> quickPage(AppRecentQuickPageVO bean) {
|
||||
// 查询当前用户信息
|
||||
MemberUserDO operationUser = memberUserService.getUser(bean.getOperationMemberId());
|
||||
|
||||
// 查询当前用户设置
|
||||
MemberRecentCfgDO operationCfg = memberRecentCfgService.getOrCreate(operationUser.getId());
|
||||
RecentPageReqVO resultQuery = BeanUtil.toBean(bean, RecentPageReqVO.class);
|
||||
resultQuery.setSceneBizType(bean.getScene().getType());
|
||||
quickBeforeQuery(operationUser, resultQuery);
|
||||
quickBeforeQuery(operationUser, operationCfg, resultQuery);
|
||||
|
||||
IPage<RecentPageResVo> recentPageList = recentMapper.pageJoin(new Page(bean.getPageNo(), bean.getPageSize()), resultQuery);
|
||||
List<RecentPageResVo> resultList = BeanUtils.toBean(recentPageList.getRecords(), RecentPageResVo.class);
|
||||
@@ -306,10 +314,11 @@ public class RecentServiceImpl implements RecentService {
|
||||
public PageResult<RecentPageResVo> quickUserPage(AppRecentQuickPageVO bean) {
|
||||
// 查询当前用户信息
|
||||
MemberUserDO operationUser = memberUserService.getUser(bean.getOperationMemberId());
|
||||
|
||||
// 查询当前用户设置
|
||||
MemberRecentCfgDO operationCfg = memberRecentCfgService.getOrCreate(operationUser.getId());
|
||||
RecentPageReqVO resultQuery = BeanUtil.toBean(bean, RecentPageReqVO.class);
|
||||
resultQuery.setSceneBizType(bean.getScene().getType());
|
||||
quickBeforeQuery(operationUser, resultQuery);
|
||||
quickBeforeQuery(operationUser, operationCfg, resultQuery);
|
||||
// 广场-最近
|
||||
if (ObjectUtil.equals(bean.getScene(), MemberRecentSceneEnum.SQUARE_NEW_TIME)) {
|
||||
resultQuery.setDistanceIsNotNull(true);
|
||||
@@ -320,14 +329,23 @@ public class RecentServiceImpl implements RecentService {
|
||||
add(MemberRecentTagEnum.NEW_PERSON.getType());
|
||||
}});
|
||||
}
|
||||
// 广场-VIP男士
|
||||
if (ObjectUtil.equals(MemberRecentSceneEnum.SQUARE_VIP_MALE, bean.getScene())) {
|
||||
resultQuery.setIsVip(true);
|
||||
}
|
||||
IPage<RecentPageResVo> recentPageList = recentMapper.pageUserJoin(new Page(bean.getPageNo(), bean.getPageSize()), resultQuery);
|
||||
List<RecentPageResVo> resultList = BeanUtils.toBean(recentPageList.getRecords(), RecentPageResVo.class);
|
||||
// 为RecentPageResVo设置Member信息
|
||||
convertRecentPageResVoSetupMember(resultList);
|
||||
// 如果是新人模糊`头像`和`用户名`
|
||||
if (ObjectUtil.equals(bean.getScene(), MemberRecentSceneEnum.SQUARE_NEW_PERSON)) {
|
||||
// 如果是`新人``女生`模糊`头像`和`用户名`
|
||||
List<MemberRecentSceneEnum> dimList = Arrays.asList(MemberRecentSceneEnum.SQUARE_NEW_PERSON, MemberRecentSceneEnum.SQUARE_FEMALE);
|
||||
if (dimList.contains(bean.getScene())) {
|
||||
for (RecentPageResVo v : resultList) {
|
||||
if (ObjectUtil.isNotEmpty(v.getMember()) && ObjectUtil.isNotEmpty(v.getMember().getMemberNickname())) {
|
||||
// 如果是自己不处理
|
||||
if (ObjectUtil.equals(v.getMember().getMemberId(), operationUser.getId())) {
|
||||
continue;
|
||||
}
|
||||
int size = v.getMember().getMemberNickname().length() + 1;
|
||||
v.getMember().setMemberNickname(StringUtils.repeat("*", size));
|
||||
}
|
||||
@@ -425,6 +443,7 @@ public class RecentServiceImpl implements RecentService {
|
||||
List<RecentPageResVo> resultList = new ArrayList<>();
|
||||
|
||||
RecentPageReqVO dtoQuery = new RecentPageReqVO();
|
||||
dtoQuery.setMemberId(dto.getOperationMemberId());
|
||||
IPage<RecentPageResVo> pageList = recentMapper.pageJoin(new Page(dto.getPageNo(), dto.getPageSize()), dtoQuery);
|
||||
if (ObjectUtil.isEmpty(pageList)) return new PageResult<>();
|
||||
resultList = BeanUtil.copyToList(pageList.getRecords(), RecentPageResVo.class);
|
||||
@@ -656,14 +675,20 @@ public class RecentServiceImpl implements RecentService {
|
||||
}
|
||||
}
|
||||
|
||||
private void quickBeforeQuery(MemberUserDO operationUser, RecentPageReqVO resultQuery) {
|
||||
private void quickBeforeQuery(MemberUserDO operationUser, MemberRecentCfgDO operationCfg, RecentPageReqVO resultQuery) {
|
||||
if (ObjectUtil.isEmpty(resultQuery)) resultQuery = new RecentPageReqVO();
|
||||
HashSet<Long> excludeUserIdList = new HashSet<>();
|
||||
// 只查询异性
|
||||
if (ObjectUtil.isNotEmpty(operationUser.getSex())) {
|
||||
SexEnum sexEnum = SexEnum.valueOfSex(operationUser.getSex());
|
||||
SexEnum targetSex = SexEnum.negation(sexEnum.getSex());
|
||||
resultQuery.setMemberSex(targetSex.getSex());
|
||||
// 只查询女生
|
||||
if (ObjectUtil.equals(resultQuery.getSceneBizType(), MemberRecentSceneEnum.SQUARE_FEMALE.getType())) {
|
||||
resultQuery.setMemberSex(operationUser.getSex());
|
||||
}
|
||||
// 只查询异性
|
||||
else {
|
||||
SexEnum targetSex = SexEnum.negation(sexEnum.getSex());
|
||||
resultQuery.setMemberSex(targetSex.getSex());
|
||||
}
|
||||
}
|
||||
// 查询用户最新的位置(根据位置的查询)
|
||||
LocationDO locationDO = locationService.getCurrentUserLastLocation();
|
||||
@@ -674,6 +699,11 @@ public class RecentServiceImpl implements RecentService {
|
||||
if (ObjectUtil.isNotEmpty(blackUserIdList)) {
|
||||
excludeUserIdList.addAll(blackUserIdList);
|
||||
}
|
||||
// 查询用户配置了首页隐身的人
|
||||
List<Long> homeHideUserIdList = memberRecentCfgService.getHomeHideUserIdList();
|
||||
if (ObjectUtil.isNotEmpty(blackUserIdList)) {
|
||||
excludeUserIdList.addAll(homeHideUserIdList);
|
||||
}
|
||||
resultQuery.setExcludeUserIdList(excludeUserIdList.stream().collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public interface ViewRecordService {
|
||||
/**
|
||||
* 获得用户查看记录分页
|
||||
*/
|
||||
PageResult<ViewRecordDO> getViewRecordPage(ViewRecordPageRespVO pageReqVO);
|
||||
PageResult<ViewRecordPageRespVO> getViewRecordPage(ViewRecordPageRespVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 我看过-分页查询
|
||||
|
||||
+23
-2
@@ -94,8 +94,17 @@ public class ViewRecordServiceImpl implements ViewRecordService {
|
||||
* 获得用户查看记录分页
|
||||
*/
|
||||
@Override
|
||||
public PageResult<ViewRecordDO> getViewRecordPage(ViewRecordPageRespVO pageReqVO) {
|
||||
return viewRecordMapper.selectPage(pageReqVO);
|
||||
public PageResult<ViewRecordPageRespVO> getViewRecordPage(ViewRecordPageRespVO pageReqVO) {
|
||||
PageResult<ViewRecordPageRespVO> resultPageList = new PageResult<>();
|
||||
PageResult<ViewRecordDO> pageList = viewRecordMapper.selectPage(pageReqVO);
|
||||
List<ViewRecordDO> list = pageList.getList();
|
||||
if (ObjectUtil.isEmpty(list)) return resultPageList;
|
||||
List<ViewRecordPageRespVO> resultList = BeanUtils.toBean(list, ViewRecordPageRespVO.class);
|
||||
// 为ViewRecordPageRespVO设置Member信息
|
||||
convertViewRecordPageRespVOSetupMember(resultList);
|
||||
resultPageList.setList(resultList);
|
||||
resultPageList.setTotal(pageList.getTotal());
|
||||
return resultPageList;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,6 +163,18 @@ public class ViewRecordServiceImpl implements ViewRecordService {
|
||||
}
|
||||
}
|
||||
|
||||
// 为ViewRecordPageRespVO设置Member信息
|
||||
private void convertViewRecordPageRespVOSetupMember(List<ViewRecordPageRespVO> list) {
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
List<Long> memberIds = list.stream().map(ViewRecordPageRespVO::getMemberId).collect(Collectors.toList());
|
||||
List<MemberExtBO> memberList = memberUserService.getUserExtList(memberIds);
|
||||
Map<Long, MemberExtBO> memberMap = IterUtil.toMap(memberList, MemberExtBO::getMemberId);
|
||||
for (ViewRecordPageRespVO entity : list) {
|
||||
MemberExtBO member = memberMap.get(entity.getMemberId());
|
||||
entity.setMember(member);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateViewRecordExists(Long id) {
|
||||
if (viewRecordMapper.selectById(id) == null) {
|
||||
throw exception(MemberErrorCode.VIEW_RECORD_NOT_EXISTS);
|
||||
|
||||
+5
@@ -25,6 +25,11 @@ public interface MemberRecentCfgService {
|
||||
*/
|
||||
MemberRecentCfgDO getOrCreate(Long memberId);
|
||||
|
||||
/**
|
||||
* 查询首页隐身的用户ids
|
||||
*/
|
||||
List<Long> getHomeHideUserIdList();
|
||||
|
||||
/**
|
||||
* 删除配置
|
||||
*/
|
||||
|
||||
+16
@@ -18,6 +18,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
@@ -95,6 +96,21 @@ public class MemberRecentCfgServiceImpl implements MemberRecentCfgService {
|
||||
return insertObj;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询首页隐身的用户ids
|
||||
*/
|
||||
@Override
|
||||
public List<Long> getHomeHideUserIdList() {
|
||||
List<MemberRecentCfgDO> list = recentCfgMapper.selectList(new LambdaQueryWrapperX<MemberRecentCfgDO>()
|
||||
.select(MemberRecentCfgDO::getMemberId)
|
||||
.eq(MemberRecentCfgDO::getHomeHide, true)
|
||||
);
|
||||
if (ObjectUtil.isEmpty(list)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return list.stream().map(MemberRecentCfgDO::getMemberId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配置
|
||||
*/
|
||||
|
||||
+12
@@ -31,6 +31,7 @@ import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO;
|
||||
import cn.iocoder.yudao.module.system.api.social.SocialClientApi;
|
||||
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxPhoneNumberInfoRespDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum;
|
||||
import cn.iocoder.yudao.module.trade.api.brokerage.TradeBrokerageUserApi;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
@@ -81,6 +82,8 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||
|
||||
@Resource
|
||||
private ChatApi chatApi;
|
||||
@Resource
|
||||
private TradeBrokerageUserApi tradeBrokerageUserApi;
|
||||
|
||||
@Override
|
||||
public MemberUserDO getUserByMobile(String mobile) {
|
||||
@@ -192,9 +195,11 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateUser(Long userId, AppMemberUserUpdateReqVO reqVO) {
|
||||
MemberUserDO updateObj = BeanUtils.toBean(reqVO, MemberUserDO.class).setId(userId);
|
||||
memberUserMapper.updateById(updateObj);
|
||||
// 修改用户相册
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getPhoto())) {
|
||||
List<PhotoDO> photoList = reqVO.getPhoto().stream().map(item -> {
|
||||
PhotoDO entity = new PhotoDO();
|
||||
@@ -206,6 +211,13 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||
}).collect(Collectors.toList());
|
||||
photoMapper.insert(photoList);
|
||||
}
|
||||
// 修改用户信息推送到聊天系统
|
||||
syncChatUser(updateObj.getId());
|
||||
// 绑定分销关系
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getInvitationCode())) {
|
||||
// 查询推广人
|
||||
tradeBrokerageUserApi.bindBrokerageUser(updateObj.getId(), reqVO.getInvitationCode());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+15
-2
@@ -113,6 +113,7 @@
|
||||
</if>
|
||||
1
|
||||
from member_user u
|
||||
left join member_open_type_user otu on u.id = otu.member_id
|
||||
<where>
|
||||
u.deleted = 0
|
||||
<if test="dto.memberSex != null">
|
||||
@@ -141,7 +142,11 @@
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="dto.isVip != null and dto.isVip == true ">
|
||||
and (otu.id is not null and otu.end_time > now())
|
||||
</if>
|
||||
</where>
|
||||
group by u.id
|
||||
<if test="dto.distanceIsNotNull != null and dto.distanceIsNotNull == true ">
|
||||
having distance is not null
|
||||
</if>
|
||||
@@ -153,11 +158,19 @@
|
||||
</if>
|
||||
<!-- 广场-最近 -->
|
||||
<if test="dto.sceneBizType == '4'.toString() ">
|
||||
order by distance asc , u.id desc
|
||||
order by distance asc , u.app_refresh_date desc
|
||||
</if>
|
||||
<!-- 广场-新人 -->
|
||||
<if test="dto.sceneBizType == '5'.toString() ">
|
||||
order by u.app_refresh_date desc
|
||||
order by u.app_refresh_date desc , distance asc
|
||||
</if>
|
||||
<!-- 广场-VIP男士 -->
|
||||
<if test="dto.sceneBizType == '6'.toString() ">
|
||||
order by u.app_refresh_date desc , distance asc
|
||||
</if>
|
||||
<!-- 广场-女生 -->
|
||||
<if test="dto.sceneBizType == '7'.toString() ">
|
||||
order by u.app_refresh_date desc , distance asc
|
||||
</if>
|
||||
</when>
|
||||
<otherwise>
|
||||
|
||||
+1
-12
@@ -80,19 +80,8 @@ public class PayWalletUserTransactionController {
|
||||
@Operation(summary = "获得钱包(用户之间的相互转账、赠送)分页")
|
||||
@PreAuthorize("@ss.hasPermission('pay:wallet-user-transition:query')")
|
||||
public CommonResult<PageResult<WalletUserTransitionRespVO>> getWalletUserTransitionPage(@Valid WalletUserTransitionPageReqVO pageReqVO) {
|
||||
PageResult<WalletUserTransitionDO> pageResult = walletUserTransitionService.getWalletUserTransitionPage(pageReqVO);
|
||||
PageResult<WalletUserTransitionDO> pageResult = walletUserTransitionService.page(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, WalletUserTransitionRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出钱包(用户之间的相互转账、赠送) Excel")
|
||||
@PreAuthorize("@ss.hasPermission('pay:wallet-user-transition:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportWalletUserTransitionExcel(@Valid WalletUserTransitionPageReqVO pageReqVO, HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<WalletUserTransitionDO> list = walletUserTransitionService.getWalletUserTransitionPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "钱包(用户之间的相互转账、赠送).xls", "数据", WalletUserTransitionRespVO.class, BeanUtils.toBean(list, WalletUserTransitionRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
-5
@@ -7,18 +7,15 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
|
||||
import cn.iocoder.yudao.framework.idempotent.core.keyresolver.impl.UserIdempotentKeyResolver;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.recharge.AppPayWalletGiftSendReqVo;
|
||||
import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.recharge.AppPayWalletRechargeCreateReqVO;
|
||||
import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.recharge.AppPayWalletRechargeCreateRespVO;
|
||||
import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.recharge.AppPayWalletRechargeRespVO;
|
||||
import cn.iocoder.yudao.module.pay.convert.wallet.PayWalletConvert;
|
||||
import cn.iocoder.yudao.module.pay.convert.wallet.PayWalletRechargeConvert;
|
||||
import cn.iocoder.yudao.module.pay.dal.dataobject.order.PayOrderDO;
|
||||
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletRechargeDO;
|
||||
import cn.iocoder.yudao.module.pay.service.order.PayOrderService;
|
||||
import cn.iocoder.yudao.module.pay.service.wallet.PayWalletRechargeService;
|
||||
import com.google.common.collect.Lists;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -28,8 +25,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.pay.controller.app.wallet;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.usertransaction.WalletUserTransitionPageReqVO;
|
||||
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.WalletUserTransitionDO;
|
||||
import cn.iocoder.yudao.module.pay.enums.transfer.PayUserTransferTypeEnum;
|
||||
import cn.iocoder.yudao.module.pay.service.wallet.WalletUserTransitionService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
|
||||
|
||||
@Tag(name = "用户 APP - 钱包(用户之间的相互转账、赠送)")
|
||||
@RestController
|
||||
@RequestMapping("/pay/wallet-user-transition")
|
||||
@Validated
|
||||
public class AppPayWalletUserTransactionController {
|
||||
|
||||
@Resource
|
||||
private WalletUserTransitionService walletUserTransitionService;
|
||||
|
||||
@GetMapping("/gift-page")
|
||||
@Operation(summary = "钱包送出礼物")
|
||||
public CommonResult<PageResult<WalletUserTransitionDO>> giftPage(WalletUserTransitionPageReqVO dto) {
|
||||
dto.setSendUserId(getLoginUserId());
|
||||
dto.setBizType(PayUserTransferTypeEnum.GIFT_TRANSFER.getType());
|
||||
return success(walletUserTransitionService.page(dto));
|
||||
}
|
||||
|
||||
}
|
||||
+10
@@ -27,42 +27,52 @@ public class WalletUserTransitionDO extends BaseDO {
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 转账类型
|
||||
*/
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 转账id
|
||||
*/
|
||||
private Long bizId;
|
||||
|
||||
/**
|
||||
* 赠送人id
|
||||
*/
|
||||
private Long sendUserId;
|
||||
|
||||
/**
|
||||
* 赠送人转账钱的余额(分)
|
||||
*/
|
||||
private Integer sendBeforeBalance;
|
||||
|
||||
/**
|
||||
* 赠送人转账后的余额(分)
|
||||
*/
|
||||
private Integer sendAfterBalance;
|
||||
|
||||
/**
|
||||
* 被赠送人id
|
||||
*/
|
||||
private Long targetUserId;
|
||||
|
||||
/**
|
||||
* 被赠送人转账钱的余额(分)
|
||||
*/
|
||||
private Integer targetBeforeBalance;
|
||||
|
||||
/**
|
||||
* 被赠送人转账后的余额(分)
|
||||
*/
|
||||
private Integer targetAfterBalance;
|
||||
|
||||
/**
|
||||
* 交易金额(分)
|
||||
*/
|
||||
private Integer price;
|
||||
|
||||
/**
|
||||
* 金额赠送标题
|
||||
*/
|
||||
|
||||
+1
-6
@@ -20,14 +20,9 @@ public interface WalletUserTransitionMapper extends BaseMapperX<WalletUserTransi
|
||||
.eqIfPresent(WalletUserTransitionDO::getBizType, reqVO.getBizType())
|
||||
.eqIfPresent(WalletUserTransitionDO::getBizId, reqVO.getBizId())
|
||||
.eqIfPresent(WalletUserTransitionDO::getSendUserId, reqVO.getSendUserId())
|
||||
.eqIfPresent(WalletUserTransitionDO::getSendBeforeBalance, reqVO.getSendBeforeBalance())
|
||||
.eqIfPresent(WalletUserTransitionDO::getSendAfterBalance, reqVO.getSendAfterBalance())
|
||||
.eqIfPresent(WalletUserTransitionDO::getTargetUserId, reqVO.getTargetUserId())
|
||||
.eqIfPresent(WalletUserTransitionDO::getTargetBeforeBalance, reqVO.getTargetBeforeBalance())
|
||||
.eqIfPresent(WalletUserTransitionDO::getTargetAfterBalance, reqVO.getTargetAfterBalance())
|
||||
.eqIfPresent(WalletUserTransitionDO::getPrice, reqVO.getPrice())
|
||||
.eqIfPresent(WalletUserTransitionDO::getTitle, reqVO.getTitle())
|
||||
.betweenIfPresent(WalletUserTransitionDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(WalletUserTransitionDO::getCreateTime)
|
||||
.orderByDesc(WalletUserTransitionDO::getId));
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.pay.service.wallet;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.usertransaction.WalletUserTransitionPageReqVO;
|
||||
@@ -37,6 +36,6 @@ public interface WalletUserTransitionService {
|
||||
/**
|
||||
* 获得钱包(用户之间的相互转账、赠送)分页
|
||||
*/
|
||||
PageResult<WalletUserTransitionDO> getWalletUserTransitionPage(WalletUserTransitionPageReqVO pageReqVO);
|
||||
PageResult<WalletUserTransitionDO> page(WalletUserTransitionPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
+1
-1
@@ -77,7 +77,7 @@ public class WalletUserTransitionServiceImpl implements WalletUserTransitionServ
|
||||
* 获得钱包(用户之间的相互转账、赠送)分页
|
||||
*/
|
||||
@Override
|
||||
public PageResult<WalletUserTransitionDO> getWalletUserTransitionPage(WalletUserTransitionPageReqVO pageReqVO) {
|
||||
public PageResult<WalletUserTransitionDO> page(WalletUserTransitionPageReqVO pageReqVO) {
|
||||
return walletUserTransitionMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user