feat:用户tag
This commit is contained in:
1 parent
9e7f58bf0d
commit
8ad378666e
25 files changed
+267
-46
No files matched your search
@@ -149,16 +149,17 @@ CREATE TABLE `member_location`
|
||||
DROP TABLE IF EXISTS `member_recent_tag`;
|
||||
CREATE TABLE `member_recent_tag`
|
||||
(
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '用户tagid',
|
||||
`member_id` bigint NOT NULL COMMENT '人员id',
|
||||
`tag_title` varchar(64) NOT NULL COMMENT 'tag标题',
|
||||
`tag_biz_id` bigint DEFAULT NULL COMMENT 'tag获取的对应id',
|
||||
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '用户tagid',
|
||||
`member_id` bigint NOT NULL COMMENT '人员id',
|
||||
`tag_title` varchar(64) NOT NULL COMMENT 'tag标题',
|
||||
`tag_biz_id` bigint DEFAULT NULL COMMENT 'tag获取的对应id',
|
||||
`tag_biz_type` char(32) DEFAULT NULL COMMENT 'tag获取的对应type',
|
||||
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 32 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '朋友圈用户tag';
|
||||
|
||||
|
||||
+2
@@ -7,6 +7,8 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
*/
|
||||
public interface MemberErrorCode {
|
||||
|
||||
ErrorCode EMPTY = new ErrorCode(1_004_000_000, "{}");
|
||||
|
||||
// ========== 用户相关 1-004-001-000 ============
|
||||
ErrorCode USER_NOT_EXISTS = new ErrorCode(1_004_001_000, "用户不存在");
|
||||
ErrorCode USER_MOBILE_NOT_EXISTS = new ErrorCode(1_004_001_001, "手机号未注册用户");
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.member.enums.tag;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.module.member.enums.MemberRecentOperateEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户朋友圈tag
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum MemberRecentTagEnum {
|
||||
|
||||
TRUE_PERSON_AUTH("1", "真人认证"),
|
||||
NEW_PERSON("2", "新人"),
|
||||
;
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static MemberRecentTagEnum valueOfType(String type) {
|
||||
return Arrays.asList(values()).stream().filter(v-> ObjectUtil.equals(v.type, type)).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
}
|
||||
-1
@@ -7,7 +7,6 @@ import cn.hutool.core.util.URLUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.iocoder.yudao.module.member.client.tool.TxMapApiTool;
|
||||
import cn.iocoder.yudao.module.member.client.vo.chat.ChatBaseRespVo;
|
||||
import cn.iocoder.yudao.module.member.client.vo.txmap.TxMapRespVo;
|
||||
import cn.iocoder.yudao.module.member.client.vo.txmap.geocoder.TxMapGeocoderReqVo;
|
||||
import cn.iocoder.yudao.module.member.client.vo.txmap.geocoder.TxMapGeocoderRespVo;
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.member.client.vo.txmap;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 腾讯地图响应体
|
||||
*/
|
||||
@Data
|
||||
public class TxMapRespVo {
|
||||
|
||||
private Integer status;
|
||||
|
||||
private String message;
|
||||
|
||||
private String request_id;
|
||||
|
||||
private String result;
|
||||
|
||||
public boolean isSuccess() {
|
||||
return status == 0;
|
||||
}
|
||||
|
||||
}
|
||||
+6
@@ -26,9 +26,15 @@ public class RecentPageReqVO extends PageParam {
|
||||
@Schema(description = "用户编号")
|
||||
private Long memberId;
|
||||
|
||||
@Schema(description = "用户昵称")
|
||||
private String memberNickname;
|
||||
|
||||
@Schema(description = "主图")
|
||||
private String coverPic;
|
||||
|
||||
@Schema(description = "视频")
|
||||
private String coverVideo;
|
||||
|
||||
@Schema(description = "描述")
|
||||
private String describe;
|
||||
|
||||
|
||||
+15
@@ -4,6 +4,8 @@ import cn.iocoder.yudao.module.member.dal.dataobject.recent.RecentDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class RecentPageResVo extends RecentDO {
|
||||
|
||||
@@ -19,6 +21,9 @@ public class RecentPageResVo extends RecentDO {
|
||||
@Schema(description = "操作统计相关")
|
||||
private OperationTotal operationTotal;
|
||||
|
||||
@Schema(description = "用户tag")
|
||||
private List<MemberTag> memberTagList;
|
||||
|
||||
@Data
|
||||
public static class MemberVo {
|
||||
|
||||
@@ -71,6 +76,16 @@ public class RecentPageResVo extends RecentDO {
|
||||
|
||||
@Schema(description = "朋友圈收藏总数")
|
||||
private Integer recentCollectTotal = 0;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class MemberTag {
|
||||
|
||||
@Schema(description = "tag标题")
|
||||
private String tagTitle;
|
||||
|
||||
@Schema(description = "tag业务类型")
|
||||
private String tagBizType;
|
||||
|
||||
}
|
||||
|
||||
|
||||
+7
@@ -2,10 +2,14 @@ package cn.iocoder.yudao.module.member.controller.admin.recent.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 朋友圈 Response VO")
|
||||
@@ -25,6 +29,9 @@ public class RecentRespVO {
|
||||
@ExcelProperty("主图")
|
||||
private String coverPic;
|
||||
|
||||
@Schema(description = "视频")
|
||||
private String coverVideo;
|
||||
|
||||
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("描述")
|
||||
private String describe;
|
||||
|
||||
+4
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.member.controller.admin.recent.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
@@ -21,6 +22,9 @@ public class RecentSaveReqVO {
|
||||
@NotEmpty(message = "主图不能为空")
|
||||
private String coverPic;
|
||||
|
||||
@Schema(description = "视频")
|
||||
private String coverVideo;
|
||||
|
||||
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "描述不能为空")
|
||||
private String description;
|
||||
|
||||
+10
-6
@@ -8,7 +8,9 @@ import cn.iocoder.yudao.module.member.convert.user.MemberUserConvert;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.group.MemberGroupDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.tag.MemberTagDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberRecentTagDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.user.MemberRecentTagMapper;
|
||||
import cn.iocoder.yudao.module.member.enums.point.MemberPointBizTypeEnum;
|
||||
import cn.iocoder.yudao.module.member.service.group.MemberGroupService;
|
||||
import cn.iocoder.yudao.module.member.service.level.MemberLevelService;
|
||||
@@ -51,6 +53,9 @@ public class MemberUserController {
|
||||
@Resource
|
||||
private MemberPointRecordService memberPointRecordService;
|
||||
|
||||
@Resource
|
||||
private MemberRecentTagMapper memberRecentTagMapper;
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新会员用户")
|
||||
@PreAuthorize("@ss.hasPermission('member:user:update')")
|
||||
@@ -93,7 +98,6 @@ public class MemberUserController {
|
||||
if (CollUtil.isEmpty(pageResult.getList())) {
|
||||
return success(PageResult.empty());
|
||||
}
|
||||
|
||||
// 处理用户标签返显
|
||||
Set<Long> tagIds = pageResult.getList().stream()
|
||||
.map(MemberUserDO::getTagIds)
|
||||
@@ -102,12 +106,12 @@ public class MemberUserController {
|
||||
.collect(Collectors.toSet());
|
||||
List<MemberTagDO> tags = memberTagService.getTagList(tagIds);
|
||||
// 处理用户级别返显
|
||||
List<MemberLevelDO> levels = memberLevelService.getLevelList(
|
||||
convertSet(pageResult.getList(), MemberUserDO::getLevelId));
|
||||
List<MemberLevelDO> levels = memberLevelService.getLevelList(convertSet(pageResult.getList(), MemberUserDO::getLevelId));
|
||||
// 处理用户分组返显
|
||||
List<MemberGroupDO> groups = memberGroupService.getGroupList(
|
||||
convertSet(pageResult.getList(), MemberUserDO::getGroupId));
|
||||
return success(MemberUserConvert.INSTANCE.convertPage(pageResult, tags, levels, groups));
|
||||
List<MemberGroupDO> groups = memberGroupService.getGroupList(convertSet(pageResult.getList(), MemberUserDO::getGroupId));
|
||||
// 处理用户朋友圈的TAG
|
||||
List<MemberRecentTagDO> memberRecentTags = memberRecentTagMapper.getByIds(convertSet(pageResult.getList(), MemberUserDO::getId));
|
||||
return success(MemberUserConvert.INSTANCE.convertPage(pageResult, tags,memberRecentTags, levels, groups));
|
||||
}
|
||||
|
||||
}
|
||||
+17
-2
@@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.user.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.member.controller.admin.recent.vo.RecentPageResVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -31,7 +32,7 @@ public class MemberUserRespVO extends MemberUserBaseVO {
|
||||
|
||||
// ========== 其它信息 ==========
|
||||
|
||||
@Schema(description = "积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
@Schema(description = "积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
private Integer point;
|
||||
|
||||
@Schema(description = "总积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "2000")
|
||||
@@ -46,7 +47,21 @@ public class MemberUserRespVO extends MemberUserBaseVO {
|
||||
@Schema(description = "用户分组", example = "购物达人")
|
||||
private String groupName;
|
||||
|
||||
@Schema(description = "用户经验值", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
||||
@Schema(description = "用户经验值", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
||||
private Integer experience;
|
||||
|
||||
@Schema(description = "用户tag")
|
||||
private List<MemberUserRespVO.MemberTag> memberTagList;
|
||||
|
||||
@Data
|
||||
public static class MemberTag {
|
||||
|
||||
@Schema(description = "tag标题")
|
||||
private String tagTitle;
|
||||
|
||||
@Schema(description = "tag业务类型")
|
||||
private String tagBizType;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+4
@@ -6,6 +6,7 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 会员用户更新 Request VO")
|
||||
@Data
|
||||
@@ -17,4 +18,7 @@ public class MemberUserUpdateReqVO extends MemberUserBaseVO {
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户标签")
|
||||
private List<String> memberRecentTagList;
|
||||
|
||||
}
|
||||
+8
-5
@@ -5,7 +5,6 @@ import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class AppRecentSaveReqVO {
|
||||
@@ -13,19 +12,23 @@ public class AppRecentSaveReqVO {
|
||||
@Schema(description = "用户编号")
|
||||
private Long memberId;
|
||||
|
||||
@Schema(description = "主图", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "视频")
|
||||
@NotEmpty(message = "视频不能为空")
|
||||
private String coverVideo;
|
||||
|
||||
@Schema(description = "主图")
|
||||
@NotEmpty(message = "主图不能为空")
|
||||
private String coverPic;
|
||||
|
||||
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "描述")
|
||||
@NotEmpty(message = "描述不能为空")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "发布-经度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "发布-经度")
|
||||
@NotNull(message = "发布-经度不能为空")
|
||||
private Double issueLong;
|
||||
|
||||
@Schema(description = "发布-纬度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "发布-纬度")
|
||||
@NotNull(message = "发布-纬度不能为空")
|
||||
private Double issueLat;
|
||||
|
||||
|
||||
+18
-2
@@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.member.convert.user;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.user.vo.MemberUserRespVO;
|
||||
@@ -9,17 +10,19 @@ import cn.iocoder.yudao.module.member.convert.address.AddressConvert;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.group.MemberGroupDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.tag.MemberTagDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberRecentTagDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.Mappings;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
|
||||
|
||||
@Mapper(uses = {AddressConvert.class})
|
||||
public interface MemberUserConvert {
|
||||
@@ -49,6 +52,7 @@ public interface MemberUserConvert {
|
||||
|
||||
default PageResult<MemberUserRespVO> convertPage(PageResult<MemberUserDO> pageResult,
|
||||
List<MemberTagDO> tags,
|
||||
List<MemberRecentTagDO> memberRecentTags,
|
||||
List<MemberLevelDO> levels,
|
||||
List<MemberGroupDO> groups) {
|
||||
PageResult<MemberUserRespVO> result = convertPage(pageResult);
|
||||
@@ -61,6 +65,18 @@ public interface MemberUserConvert {
|
||||
user.setTagNames(convertList(user.getTagIds(), tagMap::get));
|
||||
user.setLevelName(levelMap.get(user.getLevelId()));
|
||||
user.setGroupName(groupMap.get(user.getGroupId()));
|
||||
user.setMemberTagList(new ArrayList<>());
|
||||
// 处理朋友圈TAG
|
||||
List<MemberRecentTagDO> targetTags = memberRecentTags.stream().filter(v -> ObjectUtil.equals(v.getMemberId(), user.getId())).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotEmpty(targetTags)) {
|
||||
List<MemberUserRespVO.MemberTag> disposeTags = targetTags.stream().map(v -> {
|
||||
MemberUserRespVO.MemberTag entity = new MemberUserRespVO.MemberTag();
|
||||
entity.setTagTitle(v.getTagTitle());
|
||||
entity.setTagBizType(v.getTagBizType());
|
||||
return entity;
|
||||
}).collect(Collectors.toList());
|
||||
user.setMemberTagList(disposeTags);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
+5
@@ -38,6 +38,11 @@ public class RecentDO extends BaseDO {
|
||||
*/
|
||||
private String coverPic;
|
||||
|
||||
/**
|
||||
* 视频
|
||||
*/
|
||||
private String coverVideo;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
|
||||
+5
@@ -33,6 +33,11 @@ public class MemberRecentTagDO extends BaseDO {
|
||||
*/
|
||||
private String tagTitle;
|
||||
|
||||
/**
|
||||
* tag获取的对应type
|
||||
*/
|
||||
private String tagBizType;
|
||||
|
||||
/**
|
||||
* tag获取的对应id
|
||||
*/
|
||||
|
||||
+19
-15
@@ -1,33 +1,37 @@
|
||||
package cn.iocoder.yudao.module.member.dal.mysql.recent;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.recent.RecentDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.recent.vo.*;
|
||||
|
||||
/**
|
||||
* 朋友圈 Mapper
|
||||
*
|
||||
* @author 聊天交友
|
||||
*/
|
||||
@Mapper
|
||||
public interface RecentMapper extends BaseMapperX<RecentDO> {
|
||||
|
||||
default PageResult<RecentDO> selectPage(RecentPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<RecentDO>()
|
||||
.eqIfPresent(RecentDO::getMemberId, reqVO.getMemberId())
|
||||
.eqIfPresent(RecentDO::getCoverPic, reqVO.getCoverPic())
|
||||
.eqIfPresent(RecentDO::getDescription, reqVO.getDescribe())
|
||||
.eqIfPresent(RecentDO::getIssueLong, reqVO.getIssueLong())
|
||||
.eqIfPresent(RecentDO::getIssueLat, reqVO.getIssueLat())
|
||||
.eqIfPresent(RecentDO::getIssueProvince, reqVO.getIssueProvince())
|
||||
.eqIfPresent(RecentDO::getIssueCity, reqVO.getIssueCity())
|
||||
.eqIfPresent(RecentDO::getIssueDistrict, reqVO.getIssueDistrict())
|
||||
.eqIfPresent(RecentDO::getIssueAddress, reqVO.getIssueAddress())
|
||||
.betweenIfPresent(RecentDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(RecentDO::getId));
|
||||
MPJLambdaWrapper<RecentDO> queryWrapper = new MPJLambdaWrapperX<RecentDO>()
|
||||
.selectAll(RecentDO.class)
|
||||
.leftJoin(MemberUserDO.class, MemberUserDO::getId, RecentDO::getMemberId)
|
||||
.likeIfExists(MemberUserDO::getNickname, reqVO.getMemberNickname())
|
||||
.eqIfExists(RecentDO::getMemberId, reqVO.getMemberId())
|
||||
.eqIfExists(RecentDO::getDescription, reqVO.getDescribe())
|
||||
.likeIfExists(RecentDO::getIssueProvince, reqVO.getIssueProvince())
|
||||
.likeIfExists(RecentDO::getIssueCity, reqVO.getIssueCity())
|
||||
.likeIfExists(RecentDO::getIssueDistrict, reqVO.getIssueDistrict())
|
||||
.likeIfExists(RecentDO::getIssueAddress, reqVO.getIssueAddress());
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getCreateTime())) {
|
||||
queryWrapper.between(RecentDO::getCreateTime, reqVO.getCreateTime()[0], reqVO.getCreateTime()[1]);
|
||||
}
|
||||
queryWrapper.orderByDesc(RecentDO::getId);
|
||||
return selectJoinPage(reqVO, RecentDO.class, queryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
+9
@@ -1,14 +1,23 @@
|
||||
package cn.iocoder.yudao.module.member.dal.mysql.user;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberRecentTagDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 朋友圈用户tag Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MemberRecentTagMapper extends BaseMapperX<MemberRecentTagDO> {
|
||||
|
||||
default List<MemberRecentTagDO> getByIds(Set<Long> memberIds) {
|
||||
return selectList(new LambdaQueryWrapperX<MemberRecentTagDO>()
|
||||
.in(MemberRecentTagDO::getMemberId, memberIds)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
+4
-1
@@ -39,7 +39,7 @@ public class LocationServiceImpl implements LocationService {
|
||||
|
||||
@Override
|
||||
public Long createLocation(LocationSaveReqVO dto) {
|
||||
if (!ObjectUtil.isAllEmpty(dto.getProvince(), dto.getCity(), dto.getDistrict())) {
|
||||
if (!ObjectUtil.isAllNotEmpty(dto.getProvince(), dto.getCity(), dto.getDistrict())) {
|
||||
TxMapGeocoderRespVo geocoder = txMapApi.geocoder(TxMapGeocoderReqVo.builder().location(dto.getLat() + "," + dto.getLon()).build());
|
||||
if (ObjectUtil.isNotEmpty(geocoder) && ObjectUtil.isNotEmpty(geocoder.getAddress_component())) {
|
||||
TxMapGeocoderRespVo.AddressComponent addressComponent = geocoder.getAddress_component();
|
||||
@@ -47,6 +47,9 @@ public class LocationServiceImpl implements LocationService {
|
||||
dto.setCity(addressComponent.getCity());
|
||||
dto.setDistrict(addressComponent.getDistrict());
|
||||
dto.setAddress(addressComponent.getStreet());
|
||||
if (ObjectUtil.isNotEmpty(geocoder.getFormatted_addresses()) && ObjectUtil.isNotEmpty(geocoder.getFormatted_addresses().getRecommend())) {
|
||||
dto.setAddress(geocoder.getFormatted_addresses().getRecommend());
|
||||
}
|
||||
}
|
||||
}
|
||||
// 插入
|
||||
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.member.service.recent;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import javax.validation.*;
|
||||
|
||||
import cn.iocoder.yudao.module.member.controller.admin.recent.vo.*;
|
||||
|
||||
+35
-1
@@ -11,8 +11,10 @@ import cn.iocoder.yudao.module.member.controller.app.recent.vo.AppRecentOperateR
|
||||
import cn.iocoder.yudao.module.member.controller.app.recent.vo.AppRecentQuickPageVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.location.LocationDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.recent.OperationDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberRecentTagDO;
|
||||
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;
|
||||
import cn.iocoder.yudao.module.member.enums.MemberErrorCode;
|
||||
import cn.iocoder.yudao.module.member.enums.MemberRecentOperateEnum;
|
||||
import cn.iocoder.yudao.module.member.enums.MemberRecentSceneEnum;
|
||||
@@ -40,6 +42,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
@@ -56,6 +59,8 @@ public class RecentServiceImpl implements RecentService {
|
||||
private RecentMapper recentMapper;
|
||||
@Resource
|
||||
private OperationMapper operationMapper;
|
||||
@Resource
|
||||
private MemberRecentTagMapper memberRecentTagMapper;
|
||||
|
||||
@Resource
|
||||
private MemberUserService memberUserService;
|
||||
@@ -103,7 +108,7 @@ public class RecentServiceImpl implements RecentService {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("|创建朋友圈|,以外的错误error:{}", e.getMessage());
|
||||
throw new RuntimeException(e.getMessage());
|
||||
throw exception(MemberErrorCode.EMPTY, e.getMessage());
|
||||
}
|
||||
|
||||
// 返回
|
||||
@@ -228,6 +233,8 @@ public class RecentServiceImpl implements RecentService {
|
||||
convertRecentPageResVoSetupMember(resultList);
|
||||
// 为RecentPageResVo设置OperationTotal信息
|
||||
convertRecentPageResVoSetupOperationTotal(resultList, pageReqVO);
|
||||
// 为RecentPageResVo设置Tag信息
|
||||
convertRecentPageResVoSetupTag(resultList);
|
||||
return new PageResult<>(resultList, recentPageList.getTotal());
|
||||
}
|
||||
|
||||
@@ -434,6 +441,33 @@ public class RecentServiceImpl implements RecentService {
|
||||
}
|
||||
}
|
||||
|
||||
// 为RecentPageResVo设置Tag信息
|
||||
private void convertRecentPageResVoSetupTag(List<RecentPageResVo> list) {
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
List<Long> memberIds = list.stream().map(RecentPageResVo::getMemberId).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotEmpty(memberIds)) {
|
||||
List<MemberRecentTagDO> memberRecentTagList = memberRecentTagMapper.selectList(new LambdaQueryWrapperX<MemberRecentTagDO>()
|
||||
.in(MemberRecentTagDO::getMemberId, memberIds)
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(memberRecentTagList)) {
|
||||
for (RecentPageResVo entity : list) {
|
||||
List<MemberRecentTagDO> targetList = memberRecentTagList.stream().filter(v -> ObjectUtil.equals(v.getMemberId(), entity.getMemberId())).collect(Collectors.toList());
|
||||
if (ObjectUtil.isEmpty(targetList)) {
|
||||
entity.setMemberTagList(new ArrayList<>());
|
||||
continue;
|
||||
}
|
||||
List<RecentPageResVo.MemberTag> tagList = targetList.stream().map(v -> {
|
||||
RecentPageResVo.MemberTag tag = new RecentPageResVo.MemberTag();
|
||||
tag.setTagTitle(v.getTagTitle());
|
||||
tag.setTagBizType(v.getTagBizType());
|
||||
return tag;
|
||||
}).collect(Collectors.toList());
|
||||
entity.setMemberTagList(tagList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void convertRecentPageResVoSetupMember(RecentPageResVo detail) {
|
||||
if (ObjectUtil.isEmpty(detail)) return;
|
||||
MemberUserDO member = memberUserService.getUser(detail.getMemberId());
|
||||
|
||||
+1
-1
@@ -140,7 +140,7 @@ public class ThirdAuthServiceImpl implements ThirdAuthService {
|
||||
if (ObjectUtil.isEmpty(client)) return null;
|
||||
RuntimeOptions runtime = new RuntimeOptions();
|
||||
Map<String, String> serviceParameters = new HashMap<>();
|
||||
serviceParameters.put("imageUrl", "https://img.alicdn.com/tfs/TB1U4r9AeH2gK0jSZJnXXaT1FXa-2880-480.png");
|
||||
serviceParameters.put("imageUrl", imageUrl);
|
||||
serviceParameters.put("dataId", String.valueOf(UUID.randomUUID()));
|
||||
serviceParameters.put("infoType", "customImage,textInImage,publicFigure");
|
||||
ImageModerationRequest imageBatchModerationRequest = new ImageModerationRequest();
|
||||
|
||||
+26
@@ -8,6 +8,8 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import cn.iocoder.yudao.module.member.client.service.ChatApi;
|
||||
import cn.iocoder.yudao.module.member.client.vo.chat.user.ChatCreateOrUpdateUserReqVo;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.user.vo.MemberUserPageReqVO;
|
||||
@@ -16,10 +18,13 @@ import cn.iocoder.yudao.module.member.controller.app.user.vo.*;
|
||||
import cn.iocoder.yudao.module.member.convert.auth.AuthConvert;
|
||||
import cn.iocoder.yudao.module.member.convert.user.MemberUserConvert;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.photo.PhotoDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberRecentTagDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.photo.PhotoMapper;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.user.MemberRecentTagMapper;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.user.MemberUserMapper;
|
||||
import cn.iocoder.yudao.module.member.enums.photo.PhotoBizTypeEnum;
|
||||
import cn.iocoder.yudao.module.member.enums.tag.MemberRecentTagEnum;
|
||||
import cn.iocoder.yudao.module.member.mq.producer.user.MemberUserProducer;
|
||||
import cn.iocoder.yudao.module.system.api.sms.SmsCodeApi;
|
||||
import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO;
|
||||
@@ -59,6 +64,8 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||
private MemberUserMapper memberUserMapper;
|
||||
@Resource
|
||||
private PhotoMapper photoMapper;
|
||||
@Resource
|
||||
private MemberRecentTagMapper memberRecentTagMapper;
|
||||
|
||||
@Resource
|
||||
private SmsCodeApi smsCodeApi;
|
||||
@@ -269,6 +276,25 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||
|
||||
// 更新
|
||||
MemberUserDO updateObj = MemberUserConvert.INSTANCE.convert(updateReqVO);
|
||||
|
||||
// 更新用户朋友圈标签
|
||||
if (ObjectUtil.isNotEmpty(updateReqVO.getMemberRecentTagList())) {
|
||||
// 删除所有标签
|
||||
memberRecentTagMapper.delete(new LambdaQueryWrapperX<MemberRecentTagDO>()
|
||||
.eq(MemberRecentTagDO::getMemberId, updateReqVO.getId())
|
||||
);
|
||||
// 添加标签
|
||||
List<MemberRecentTagDO> tags = updateReqVO.getMemberRecentTagList().stream().map(v -> {
|
||||
MemberRecentTagEnum tagEnum = MemberRecentTagEnum.valueOfType(v);
|
||||
if (ObjectUtil.isEmpty(tagEnum)) return null;
|
||||
MemberRecentTagDO entity = new MemberRecentTagDO();
|
||||
entity.setMemberId(updateReqVO.getId());
|
||||
entity.setTagTitle(tagEnum.getDescription());
|
||||
entity.setTagBizType(tagEnum.getType());
|
||||
return entity;
|
||||
}).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
||||
memberRecentTagMapper.insert(tags);
|
||||
}
|
||||
memberUserMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -28,8 +28,8 @@
|
||||
resultType="cn.iocoder.yudao.module.member.controller.admin.recent.vo.OperationTotalGroupRecentRespVO">
|
||||
select
|
||||
sum(if(a.biz_type = '1', 1, 0)) as likeTotal,
|
||||
sum(if(a.biz_type = '1' and a.operator_member_id = #{userId}, 1, 0)) as likeItTotal,
|
||||
sum(if(a.biz_type = '1' and a.member_id = #{userId}, 1, 0)) as likeMeTotal,
|
||||
sum(if(a.biz_type = '1' and a.operator_member_id = #{dto.memberId}, 1, 0)) as likeItTotal,
|
||||
sum(if(a.biz_type = '1' and a.member_id = #{dto.memberId}, 1, 0)) as likeMeTotal,
|
||||
sum(if(a.biz_type = '2', 1, 0)) as reportTotal,
|
||||
sum(if(a.biz_type = '3', 1, 0)) as shieldTotal,
|
||||
sum(if(a.biz_type = '4', 1, 0)) as collectTotal,
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.member.dal.mysql.recent.RecentMapper">
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in new issue
Block a user