|
|
@ -19,7 +19,6 @@ package com.epmet.modules.member.redis; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.redis.RedisUtils; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
@ -32,10 +31,10 @@ import com.epmet.modules.feign.EpmetUserFeignClient; |
|
|
|
import com.epmet.modules.group.service.ResiGroupService; |
|
|
|
import com.epmet.modules.member.service.ResiGroupMemberService; |
|
|
|
import com.epmet.modules.utils.ModuleConstant; |
|
|
|
import com.epmet.resi.group.constant.TopicConstant; |
|
|
|
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; |
|
|
|
import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; |
|
|
|
import com.epmet.resi.group.dto.member.result.ResiGroupMemberInfoRedisResultDTO; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
@ -99,11 +98,23 @@ public class ResiGroupMemberRedis { |
|
|
|
(ResiGroupMemberInfoRedisDTO) redisUtils.get(ResiGroupRedisKeys.getResiGroupMemberInfoKey(groupId,userId)); |
|
|
|
//如果缓存中没有该成员数据
|
|
|
|
if(null == memberCache || StringUtils.isBlank(memberCache.getUserId())){ |
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
/*Map<String,Object> param = new HashMap<>(); |
|
|
|
param.put(TopicConstant.CUSTOMER_USER_ID,userId); |
|
|
|
param.put(TopicConstant.RESI_GROUP_ID,groupId); |
|
|
|
param.put(FieldConstant.DEL_FLAG, NumConstant.ZERO_STR); |
|
|
|
List<ResiGroupMemberDTO> memberList = memberService.list(param); |
|
|
|
List<ResiGroupMemberDTO> memberList = memberService.list(param);*/ |
|
|
|
List<ResiGroupMemberDTO> memberList=new ArrayList<>(); |
|
|
|
ResiGroupMemberDTO resiGroupMemberDTO=memberService.getResiGroupMember(groupId,userId); |
|
|
|
if (null == resiGroupMemberDTO) { |
|
|
|
//查询组员被移除的记录
|
|
|
|
List<ResiGroupMemberDTO> delMemberList = memberService.queryMemberRemovedRecs(groupId, userId); |
|
|
|
if (CollectionUtils.isNotEmpty(delMemberList)) { |
|
|
|
logger.warn(String.format("groupId=%s,userId=%s,组员已被删除", groupId, userId)); |
|
|
|
memberList.add(delMemberList.get(NumConstant.ZERO)); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
memberList.add(resiGroupMemberDTO); |
|
|
|
} |
|
|
|
if(null != memberList && memberList.size() >= 1){ |
|
|
|
if(memberList.size() > 1) { |
|
|
|
memberList.sort(Comparator.comparing(ResiGroupMemberDTO::getCreatedTime, Collections.reverseOrder())); |
|
|
|