11
This commit is contained in:
1 parent
f56d578fbb
commit
f5e64795cd
16 files changed
+230
-41
No files matched your search
+12
-2
@@ -27,9 +27,9 @@ public enum MemberRecentOperateEnum {
|
||||
*/
|
||||
RECENT_SHIELD("3", "屏蔽"),
|
||||
/**
|
||||
* 用户-收藏(个人中心我喜欢)
|
||||
* 用户-点赞(个人中心我喜欢)
|
||||
*/
|
||||
MEMBER_COLLECT("4", "收藏"),
|
||||
MEMBER_COLLECT("4", "点赞"),
|
||||
/**
|
||||
* 用户-屏蔽
|
||||
*/
|
||||
@@ -46,6 +46,16 @@ public enum MemberRecentOperateEnum {
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static List<MemberRecentOperateEnum> allList = new ArrayList<MemberRecentOperateEnum>() {{
|
||||
add(RECENT_LIKE);
|
||||
add(RECENT_REPORT);
|
||||
add(RECENT_SHIELD);
|
||||
add(MEMBER_COLLECT);
|
||||
add(MEMBER_SHIELD);
|
||||
add(MEMBER_REPORT);
|
||||
add(MEMBER_RATING);
|
||||
}};
|
||||
|
||||
public static List<MemberRecentOperateEnum> userOperateList = new ArrayList<MemberRecentOperateEnum>() {{
|
||||
add(MEMBER_COLLECT);
|
||||
add(MEMBER_SHIELD);
|
||||
|
||||
+1
@@ -15,6 +15,7 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public enum MemberComAuthStatusEnum {
|
||||
|
||||
CANCEL("0", "取消"),
|
||||
WAIT_AUTH("1", "待认证"),
|
||||
CHECK("2", "审核中"),
|
||||
CHECK_PASS("3", "审核通过"),
|
||||
|
||||
+3
@@ -9,6 +9,9 @@ public class OperationStatusVo {
|
||||
@Schema(description = "用户id")
|
||||
private Long memberId;
|
||||
|
||||
@Schema(description = "朋友圈id")
|
||||
private Long memberRecentId;
|
||||
|
||||
@Schema(description = "是否点赞")
|
||||
private Boolean isLike = false;
|
||||
|
||||
|
||||
+9
-3
@@ -13,6 +13,15 @@ public class OperationTotalGroupRecentRespVO {
|
||||
@Schema(description = "操作类型")
|
||||
private String bizType;
|
||||
|
||||
@Schema(description = "用户点赞总数")
|
||||
private Integer userLikeTotal = 0;
|
||||
|
||||
@Schema(description = "用户我点赞总数")
|
||||
private Integer userLikeItTotal = 0;
|
||||
|
||||
@Schema(description = "用户点赞我总数")
|
||||
private Integer userLikeMeTotal = 0;
|
||||
|
||||
@Schema(description = "朋友圈点赞总数")
|
||||
private Integer likeTotal = 0;
|
||||
|
||||
@@ -27,7 +36,4 @@ public class OperationTotalGroupRecentRespVO {
|
||||
|
||||
@Schema(description = "朋友圈屏蔽总数")
|
||||
private Integer shieldTotal = 0;
|
||||
|
||||
@Schema(description = "收藏总数")
|
||||
private Integer collectTotal = 0;
|
||||
}
|
||||
+6
-3
@@ -20,7 +20,10 @@ public class RecentPageResVo extends RecentDO {
|
||||
private OperationTotal operationTotal;
|
||||
|
||||
@Schema(description = "操作相关状态")
|
||||
private OperationStatusVo operationStatus;
|
||||
private OperationStatusVo userOperationStatus;
|
||||
|
||||
@Schema(description = "操作相关状态")
|
||||
private OperationStatusVo recentOperationStatus;
|
||||
|
||||
@Schema(description = "用户tag")
|
||||
private List<MemberTag> memberTagList;
|
||||
@@ -83,8 +86,8 @@ public class RecentPageResVo extends RecentDO {
|
||||
@Schema(description = "朋友圈屏蔽总数")
|
||||
private Integer recentShieldTotal = 0;
|
||||
|
||||
@Schema(description = "朋友圈收藏总数")
|
||||
private Integer recentCollectTotal = 0;
|
||||
@Schema(description = "用户点赞总数")
|
||||
private Integer userLikeTotal = 0;
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
+6
-1
@@ -9,10 +9,12 @@ import cn.iocoder.yudao.module.member.client.vo.thirdfaceverify.ThirdFindFaceVer
|
||||
import cn.iocoder.yudao.module.member.client.vo.thirdfaceverify.ThirdFindFaceVerifyResVo;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.thirdcallback.vo.FaceVerifyCallbackReqVo;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.comauth.ComAuthDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.comauth.ComAuthMapper;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.user.MemberUserMapper;
|
||||
import cn.iocoder.yudao.module.member.enums.auth.MemberComAuthStatusEnum;
|
||||
import cn.iocoder.yudao.module.member.framework.web.config.ThirdAlConfig;
|
||||
import cn.iocoder.yudao.module.member.service.comauth.ComAuthService;
|
||||
import cn.iocoder.yudao.module.member.service.user.MemberRecentTagService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -40,6 +42,8 @@ public class ThirdCallbackController {
|
||||
|
||||
@Resource
|
||||
private ThirdFaceVerifyService thirdFaceVerifyService;
|
||||
@Resource
|
||||
private MemberRecentTagService memberRecentTagService;
|
||||
|
||||
@GetMapping("/face-verify")
|
||||
@Operation(summary = "人脸认证回调")
|
||||
@@ -78,6 +82,7 @@ public class ThirdCallbackController {
|
||||
updateObj.setFailReason(faceVerifyRes.getErrorMessage());
|
||||
if (faceVerifyRes.isPassed()) {
|
||||
updateObj.setAuthStatus(MemberComAuthStatusEnum.CHECK_PASS.getType());
|
||||
memberRecentTagService.setPersonTag(auth.getAuthMemberId(), true);
|
||||
}
|
||||
if (faceVerifyRes.isNotPassed()) {
|
||||
updateObj.setAuthStatus(MemberComAuthStatusEnum.CHECK_FAIL.getType());
|
||||
|
||||
+3
-3
@@ -4,13 +4,11 @@ import java.util.*;
|
||||
|
||||
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.controller.admin.recent.vo.*;
|
||||
import cn.iocoder.yudao.module.member.controller.app.recent.vo.AppEvaluateDetailResVo;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.recent.OperationDO;
|
||||
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;
|
||||
@@ -48,5 +46,7 @@ public interface OperationMapper extends BaseMapperX<OperationDO> {
|
||||
|
||||
AppEvaluateDetailResVo evaluateDetail(@Param("userId") Long userid);
|
||||
|
||||
List<OperationStatusVo> getOperationStatus(@Param("operationUserId") Long operationUserId, @Param("userIdList") List<Long> userIdList);
|
||||
List<OperationStatusVo> getUserOperationStatus(@Param("operationUserId") Long operationUserId, @Param("userIdList") List<Long> userIdList);
|
||||
|
||||
List<OperationStatusVo> getRecentOperationStatus(@Param("operationUserId") Long operateUserId, @Param("recentIdList") List<Long> recentIdList);
|
||||
}
|
||||
-1
@@ -25,5 +25,4 @@ public interface MemberRecentTagMapper extends BaseMapperX<MemberRecentTagDO> {
|
||||
.eq(MemberRecentTagDO::getMemberId, memberId)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
+25
-1
@@ -16,10 +16,15 @@ import cn.iocoder.yudao.module.member.controller.app.comauth.vo.CreateWomanAuthR
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.comauth.ComAuthDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.comauth.ComAuthMapper;
|
||||
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.auth.MemberComAuthEnum;
|
||||
import cn.iocoder.yudao.module.member.enums.MemberErrorCode;
|
||||
import cn.iocoder.yudao.module.member.enums.auth.MemberComAuthStatusEnum;
|
||||
import cn.iocoder.yudao.module.member.service.user.MemberRecentTagService;
|
||||
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import kotlin.jvm.internal.Lambda;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -48,11 +53,15 @@ public class ComAuthServiceImpl implements ComAuthService {
|
||||
|
||||
@Resource
|
||||
private ComAuthMapper authMapper;
|
||||
@Resource
|
||||
private MemberUserMapper memberUserMapper;
|
||||
|
||||
@Resource
|
||||
private MemberUserService memberUserService;
|
||||
@Resource
|
||||
private ThirdFaceVerifyService thirdFaceVerifyService;
|
||||
@Resource
|
||||
private MemberRecentTagService memberRecentTagService;
|
||||
|
||||
/**
|
||||
* 创建用户认证
|
||||
@@ -137,7 +146,13 @@ public class ComAuthServiceImpl implements ComAuthService {
|
||||
if (ObjectUtil.isNotEmpty(userAuth.getBizId()) && isStartEnumList.contains(userAuth.getAuthStatus())) {
|
||||
return userAuth;
|
||||
}
|
||||
throw exception(MemberErrorCode.COM_AUTH_EXISTS);
|
||||
// 审核失败直接删除
|
||||
List<String> isDelEnumList = Arrays.asList(MemberComAuthStatusEnum.CHECK_PASS.getType(), MemberComAuthStatusEnum.CHECK_FAIL.getType());
|
||||
if (ObjectUtil.isNotEmpty(userAuth.getBizId()) && isDelEnumList.contains(userAuth.getAuthStatus())) {
|
||||
authMapper.deleteById(userAuth.getId());
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,6 +249,7 @@ public class ComAuthServiceImpl implements ComAuthService {
|
||||
for (ComAuthDO auth : faceVerifyList) {
|
||||
ComAuthDO entity = new ComAuthDO();
|
||||
entity.setId(auth.getId());
|
||||
entity.setAuthMemberId(auth.getAuthMemberId());
|
||||
entity.setAuthTime(LocalDateTime.now());
|
||||
|
||||
ThirdFindFaceVerifyReqVo dto = new ThirdFindFaceVerifyReqVo();
|
||||
@@ -253,6 +269,14 @@ public class ComAuthServiceImpl implements ComAuthService {
|
||||
updateList.add(entity);
|
||||
}
|
||||
authMapper.updateBatch(updateList);
|
||||
updateList.forEach(v -> {
|
||||
if (ObjectUtil.isNotEmpty(v.getAuthMemberId())) {
|
||||
boolean isAddTag = ObjectUtil.equals(v.getAuthStatus(), MemberComAuthStatusEnum.CHECK_PASS.getType());
|
||||
if (isAddTag) {
|
||||
memberRecentTagService.setPersonTag(v.getAuthMemberId(), isAddTag);
|
||||
}
|
||||
}
|
||||
});
|
||||
return totalSync;
|
||||
}
|
||||
|
||||
|
||||
+9
-2
@@ -41,10 +41,17 @@ public interface OperationService {
|
||||
*/
|
||||
PageResult<OperationRespVO> getOperationPage(OperationPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 查询用户操作状态
|
||||
*/
|
||||
List<OperationStatusVo> getUserOperationStatus(Long operateUserId, List<Long> userList);
|
||||
|
||||
OperationStatusVo getUserOperationStatus(Long operateUserId, Long userList);
|
||||
|
||||
/**
|
||||
* 查询朋友圈操作状态
|
||||
*/
|
||||
List<OperationStatusVo> getOperationStatus(Long operateUserId, List<Long> userList);
|
||||
List<OperationStatusVo> getRecentOperationStatus(Long operateUserId, List<Long> recentIdList);
|
||||
|
||||
OperationStatusVo getOperationStatus(Long operateUserId, Long userList);
|
||||
OperationStatusVo getRecentOperationStatus(Long operateUserId, Long recentIdList);
|
||||
}
|
||||
+21
-5
@@ -79,20 +79,36 @@ public class OperationServiceImpl implements OperationService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询朋友圈操作状态
|
||||
* 查询用户操作状态
|
||||
*/
|
||||
@Override
|
||||
public List<OperationStatusVo> getOperationStatus(Long operateUserId, List<Long> list) {
|
||||
return operationMapper.getOperationStatus(operateUserId, list);
|
||||
public List<OperationStatusVo> getUserOperationStatus(Long operateUserId, List<Long> list) {
|
||||
return operationMapper.getUserOperationStatus(operateUserId, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationStatusVo getOperationStatus(Long operateUserId, Long userList) {
|
||||
List<OperationStatusVo> list = operationMapper.getOperationStatus(operateUserId, Arrays.asList(userList));
|
||||
public OperationStatusVo getUserOperationStatus(Long operateUserId, Long userList) {
|
||||
List<OperationStatusVo> list = operationMapper.getUserOperationStatus(operateUserId, Arrays.asList(userList));
|
||||
if (ObjectUtil.isNotEmpty(list) && list.size() == 1) {
|
||||
return list.get(0);
|
||||
}
|
||||
return new OperationStatusVo();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询朋友圈操作状态
|
||||
*/
|
||||
@Override
|
||||
public List<OperationStatusVo> getRecentOperationStatus(Long operateUserId, List<Long> recentIdList) {
|
||||
return operationMapper.getRecentOperationStatus(operateUserId, recentIdList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationStatusVo getRecentOperationStatus(Long operateUserId, Long recentIdList) {
|
||||
List<OperationStatusVo> list = operationMapper.getRecentOperationStatus(operateUserId, Arrays.asList(recentIdList));
|
||||
if (ObjectUtil.isNotEmpty(list) && list.size() == 1) {
|
||||
return list.get(0);
|
||||
}
|
||||
return new OperationStatusVo();
|
||||
}
|
||||
}
|
||||
+44
-9
@@ -15,10 +15,8 @@ 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.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.recent.OperationMapper;
|
||||
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.MemberErrorCode;
|
||||
import cn.iocoder.yudao.module.member.enums.MemberRecentOperateEnum;
|
||||
import cn.iocoder.yudao.module.member.enums.MemberRecentSceneEnum;
|
||||
@@ -33,7 +31,6 @@ 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.mapstruct.ap.internal.model.assignment.UpdateWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -260,7 +257,7 @@ public class RecentServiceImpl implements RecentService {
|
||||
// 为RecentPageResVo设置Member信息
|
||||
convertRecentPageResVoSetupMember(resultList);
|
||||
// 为RecentPageResVo设置OperationTotal信息
|
||||
convertRecentPageResVoSetupOperationTotal(resultList, pageReqVO);
|
||||
convertRecentPageResVoSetupOperationTotal(resultList);
|
||||
// 为RecentPageResVo设置Tag信息
|
||||
convertRecentPageResVoSetupTag(resultList);
|
||||
return new PageResult<>(resultList, recentPageList.getTotal());
|
||||
@@ -293,6 +290,10 @@ public class RecentServiceImpl implements RecentService {
|
||||
convertRecentPageResVoSetupMember(resultList);
|
||||
// 查询用户tag
|
||||
convertRecentPageResVoSetupTag(resultList);
|
||||
// 为RecentPageResVo设置OperationTotal信息
|
||||
convertRecentPageResVoSetupOperationTotal(resultList);
|
||||
// 为RecentPageResVo设置OperationStatus信息
|
||||
convertRecentPageResVoSetupRecentOperationStatus(resultList, bean.getOperationMemberId());
|
||||
return new PageResult<>(resultList, recentPageList.getTotal());
|
||||
}
|
||||
|
||||
@@ -454,9 +455,9 @@ public class RecentServiceImpl implements RecentService {
|
||||
// 添加用户相册
|
||||
convertRecentPageResVoSetupPhoto(result);
|
||||
// 查询用户操作状态
|
||||
OperationStatusVo operation = operationService.getOperationStatus(operateUserId, userId);
|
||||
OperationStatusVo operation = operationService.getUserOperationStatus(operateUserId, userId);
|
||||
if (ObjectUtil.isNotEmpty(operation)) {
|
||||
result.setOperationStatus(operation);
|
||||
result.setUserOperationStatus(operation);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -513,12 +514,12 @@ public class RecentServiceImpl implements RecentService {
|
||||
/**
|
||||
* 为RecentPageResVo设置OperationTotal信息
|
||||
*/
|
||||
private void convertRecentPageResVoSetupOperationTotal(List<RecentPageResVo> list, RecentPageReqVO query) {
|
||||
private void convertRecentPageResVoSetupOperationTotal(List<RecentPageResVo> list) {
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
List<Long> ids = list.stream().map(RecentPageResVo::getId).collect(Collectors.toList());
|
||||
|
||||
OperationPageReqVO operationTotalQuery = new OperationPageReqVO();
|
||||
List<String> bizTypes = MemberRecentOperateEnum.userOperateList.stream().map(MemberRecentOperateEnum::getType).collect(Collectors.toList());
|
||||
List<String> bizTypes = MemberRecentOperateEnum.allList.stream().map(MemberRecentOperateEnum::getType).collect(Collectors.toList());
|
||||
operationTotalQuery.setBizTypes(bizTypes);
|
||||
operationTotalQuery.setMemberRecentIds(ids);
|
||||
List<OperationTotalGroupRecentRespVO> totalList = operationMapper.totalGroupRecent(operationTotalQuery);
|
||||
@@ -531,7 +532,7 @@ public class RecentServiceImpl implements RecentService {
|
||||
operationTotal.setRecentLikeTotal(total.getLikeTotal());
|
||||
operationTotal.setRecentReportTotal(total.getReportTotal());
|
||||
operationTotal.setRecentShieldTotal(total.getShieldTotal());
|
||||
operationTotal.setRecentCollectTotal(total.getCollectTotal());
|
||||
operationTotal.setUserLikeTotal(total.getUserLikeTotal());
|
||||
entity.setOperationTotal(operationTotal);
|
||||
} else {
|
||||
entity.setOperationTotal(new RecentPageResVo.OperationTotal());
|
||||
@@ -559,6 +560,40 @@ public class RecentServiceImpl implements RecentService {
|
||||
}
|
||||
}
|
||||
|
||||
// 为RecentPageResVo设置userOperationStatus信息
|
||||
private void convertRecentPageResVoSetupUserOperationStatus(List<RecentPageResVo> list, Long operateUserId) {
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
List<Long> memberIds = list.stream().map(RecentPageResVo::getMemberId).collect(Collectors.toList());
|
||||
List<OperationStatusVo> operationStatusList = operationService.getUserOperationStatus(operateUserId, memberIds);
|
||||
if (ObjectUtil.isEmpty(operationStatusList)) return;
|
||||
Map<Long, OperationStatusVo> totalMap = IterUtil.toMap(operationStatusList, OperationStatusVo::getMemberId);
|
||||
for (RecentPageResVo entity : list) {
|
||||
OperationStatusVo target = totalMap.get(entity.getMemberId());
|
||||
if (ObjectUtil.isEmpty(target)) {
|
||||
entity.setUserOperationStatus(new OperationStatusVo());
|
||||
continue;
|
||||
}
|
||||
entity.setUserOperationStatus(target);
|
||||
}
|
||||
}
|
||||
|
||||
// 为RecentPageResVo设置recentOperationStatus信息
|
||||
private void convertRecentPageResVoSetupRecentOperationStatus(List<RecentPageResVo> list, Long operateUserId) {
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
List<Long> recentIds = list.stream().map(RecentPageResVo::getId).collect(Collectors.toList());
|
||||
List<OperationStatusVo> operationStatusList = operationService.getRecentOperationStatus(operateUserId, recentIds);
|
||||
if (ObjectUtil.isEmpty(operationStatusList)) return;
|
||||
Map<Long, OperationStatusVo> totalMap = IterUtil.toMap(operationStatusList, OperationStatusVo::getMemberId);
|
||||
for (RecentPageResVo entity : list) {
|
||||
OperationStatusVo target = totalMap.get(entity.getMemberId());
|
||||
if (ObjectUtil.isEmpty(target)) {
|
||||
entity.setRecentOperationStatus(new OperationStatusVo());
|
||||
continue;
|
||||
}
|
||||
entity.setRecentOperationStatus(target);
|
||||
}
|
||||
}
|
||||
|
||||
// 为RecentPageResVo设置Tag信息
|
||||
private void convertRecentPageResVoSetupTag(List<RecentPageResVo> list) {
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package cn.iocoder.yudao.module.member.service.user;
|
||||
|
||||
/**
|
||||
* 用户tag
|
||||
*/
|
||||
public interface MemberRecentTagService {
|
||||
|
||||
/**
|
||||
* 设置用户真人认证tag
|
||||
*/
|
||||
void setPersonTag(Long authMemberId, boolean isAddTag);
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.member.service.user;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberRecentTagDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.user.MemberRecentTagMapper;
|
||||
import cn.iocoder.yudao.module.member.enums.tag.MemberRecentTagEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Service
|
||||
@Valid
|
||||
@Slf4j
|
||||
public class MemberRecentTagServiceImp implements MemberRecentTagService {
|
||||
|
||||
@Resource
|
||||
private MemberRecentTagMapper memberRecentTagMapper;
|
||||
|
||||
/**
|
||||
* 设置用户真人认证tag
|
||||
*/
|
||||
@Override
|
||||
public void setPersonTag(Long authMemberId, boolean isAddTag) {
|
||||
MemberRecentTagDO detail = memberRecentTagMapper.selectOne(new LambdaQueryWrapperX<MemberRecentTagDO>()
|
||||
.eq(MemberRecentTagDO::getMemberId, authMemberId)
|
||||
.eq(MemberRecentTagDO::getTagBizType, MemberRecentTagEnum.TRUE_PERSON_AUTH.getType())
|
||||
);
|
||||
MemberRecentTagDO obj = new MemberRecentTagDO();
|
||||
obj.setTagBizId(null);
|
||||
obj.setMemberId(authMemberId);
|
||||
obj.setTagBizType(MemberRecentTagEnum.TRUE_PERSON_AUTH.getType());
|
||||
obj.setTagTitle(MemberRecentTagEnum.TRUE_PERSON_AUTH.getDescription());
|
||||
if (ObjectUtil.isEmpty(detail)) {
|
||||
if (isAddTag) {
|
||||
memberRecentTagMapper.insert(obj);
|
||||
}
|
||||
} else {
|
||||
if (!isAddTag) {
|
||||
memberRecentTagMapper.deleteById(detail.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-2
@@ -51,8 +51,6 @@ import static cn.iocoder.yudao.module.member.enums.MemberErrorCode.*;
|
||||
|
||||
/**
|
||||
* 会员 User Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Valid
|
||||
|
||||
+32
-9
@@ -26,12 +26,14 @@
|
||||
<select id="totalGroupRecent"
|
||||
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 = #{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 = '1' and a.cancel_time is null, 1, 0)) as likeTotal,
|
||||
sum(if(a.biz_type = '1' and a.cancel_time is null and a.operator_member_id = #{dto.memberId}, 1, 0)) as likeItTotal,
|
||||
sum(if(a.biz_type = '1' and a.cancel_time is null 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,
|
||||
sum(if(a.biz_type = '4' and a.cancel_time is null, 1, 0)) as userLikeTotal,
|
||||
sum(if(a.biz_type = '4' and a.cancel_time is null and a.operator_member_id = #{dto.memberId}, 1, 0)) as userLikeItTotal,
|
||||
sum(if(a.biz_type = '4' and a.cancel_time is null and a.member_id = #{dto.memberId}, 1, 0)) as userLikeMeTotal,
|
||||
a.biz_type as bizType,
|
||||
a.member_recent_id as memberRecentId
|
||||
from member_operation a
|
||||
@@ -43,12 +45,14 @@
|
||||
|
||||
<select id="totalGroupRecentByUser"
|
||||
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 = '4' and a.cancel_time is null and a.operator_member_id = #{userId}, 1, 0)) as likeItTotal,
|
||||
sum(if(a.biz_type = '4' and a.cancel_time is null and a.member_id = #{userId}, 1, 0)) as likeMeTotal,
|
||||
select sum(if(a.biz_type = '1' and a.cancel_time is null, 1, 0)) as likeTotal,
|
||||
sum(if(a.biz_type = '1' and a.cancel_time is null and a.operator_member_id = #{userId}, 1, 0)) as likeItTotal,
|
||||
sum(if(a.biz_type = '1' and a.cancel_time is null and a.member_id = #{userId}, 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,
|
||||
sum(if(a.biz_type = '4' and a.cancel_time is null, 1, 0)) as userLikeTotal,
|
||||
sum(if(a.biz_type = '4' and a.cancel_time is null and a.operator_member_id = #{userId}, 1, 0)) as userLikeItTotal,
|
||||
sum(if(a.biz_type = '4' and a.cancel_time is null and a.member_id = #{userId}, 1, 0)) as userLikeMeTotal,
|
||||
a.biz_type as bizType,
|
||||
a.member_recent_id as memberRecentId
|
||||
from member_operation a
|
||||
@@ -68,7 +72,7 @@
|
||||
group by a.member_id
|
||||
</select>
|
||||
|
||||
<select id="getOperationStatus"
|
||||
<select id="getUserOperationStatus"
|
||||
resultType="cn.iocoder.yudao.module.member.controller.admin.recent.vo.OperationStatusVo">
|
||||
select
|
||||
a.member_id,
|
||||
@@ -88,4 +92,23 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getRecentOperationStatus"
|
||||
resultType="cn.iocoder.yudao.module.member.controller.admin.recent.vo.OperationStatusVo">
|
||||
select
|
||||
a.member_recent_id,
|
||||
if(a.biz_type = '1' and a.cancel_time is null, true, false) as isLike
|
||||
from member_operation a
|
||||
<where>
|
||||
a.deleted = '0'
|
||||
<if test="operationUserId != null">
|
||||
and a.operator_member_id = #{operationUserId}
|
||||
</if>
|
||||
<if test="recentIdList != null and recentIdList.size() != 0">
|
||||
and a.member_recent_id in
|
||||
<foreach collection="recentIdList" item="v" open="(" close=")" separator=",">
|
||||
#{v}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in new issue
Block a user