|
|
@ -17,7 +17,6 @@ |
|
|
|
|
|
|
|
package com.epmet.modules.group.service.impl; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
@ -26,18 +25,18 @@ import com.epmet.commons.tools.constant.*; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.RedisKeys; |
|
|
|
import com.epmet.commons.tools.redis.RedisUtils; |
|
|
|
import com.epmet.commons.tools.scan.param.ImgScanParamDTO; |
|
|
|
import com.epmet.commons.tools.scan.param.ImgTaskDTO; |
|
|
|
import com.epmet.commons.tools.scan.param.TextScanParamDTO; |
|
|
|
import com.epmet.commons.tools.scan.param.TextTaskDTO; |
|
|
|
import com.epmet.commons.tools.scan.result.SyncScanResult; |
|
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|
|
|
import com.epmet.commons.tools.utils.*; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.utils.ScanContentUtils; |
|
|
|
import com.epmet.constant.ReadFlagConstant; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.UserBaseInfoResultDTO; |
|
|
|
import com.epmet.dto.result.UserResiInfoResultDTO; |
|
|
|
import com.epmet.dto.result.UserRoleResultDTO; |
|
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
@ -146,9 +145,6 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
|
@Autowired |
|
|
|
private LoginUserUtil loginUserUtil; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private CpUserDetailRedis sysUserInfoRedis; |
|
|
|
|
|
|
|
@Value("${openapi.scan.server.url}") |
|
|
|
private String scanApiUrl; |
|
|
|
|
|
|
@ -160,8 +156,6 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ResiGroupCodeService resiGroupCodeService; |
|
|
|
@Autowired |
|
|
|
private RedisUtils redisUtils; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<ResiGroupDTO> page(Map<String, Object> params) { |
|
|
@ -1006,39 +1000,12 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
|
//显示当前网格内所有当前用户还未加入的组,以组的人数由高到低排序;如果人数相同,以话题数由多到少排序
|
|
|
|
List<RecommendedListResultDTO> recommendGroupList = baseDao.selectListRecommendList(formDTO); |
|
|
|
recommendGroupList.forEach(dto -> { |
|
|
|
ResiGroupMemberDTO groupMemberDTO = baseDao.selectGroupLeader(dto.getGroupId()); |
|
|
|
if (groupMemberDTO == null) { |
|
|
|
logger.error("recommendedList 组长信息不存在,groupId:{}", dto.getGroupId()); |
|
|
|
return; |
|
|
|
} |
|
|
|
//获取居民缓存key
|
|
|
|
Map<String, Object> map = redisUtils.hGetAll(RedisKeys.getResiUserKey(groupMemberDTO.getCustomerUserId())); |
|
|
|
UserBaseInfoResultDTO userInfo = null; |
|
|
|
if (null != map && !map.isEmpty()) { |
|
|
|
//缓存中有数据,直接返回
|
|
|
|
userInfo = BeanUtil.mapToBean(map, UserBaseInfoResultDTO.class, true); |
|
|
|
} |
|
|
|
if (userInfo == null) { |
|
|
|
logger.error("recommendedList 用户基础信息不存在,customerUserId:{}", groupMemberDTO.getCustomerUserId()); |
|
|
|
Result<UserResiInfoResultDTO> groupLeaderUserInfo = this.getGroupLeaderUserInfo(dto.getGroupId()); |
|
|
|
|
|
|
|
if (groupLeaderUserInfo.success() && null != groupLeaderUserInfo.getData()) { |
|
|
|
dto.setLeaderName(groupLeaderUserInfo.getData().getShowName()); |
|
|
|
} else { |
|
|
|
logger.error("组长注册信息查询失败,msg:{},groupId:{}", groupLeaderUserInfo.getMsg(), dto.getGroupId()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
String gender = null; |
|
|
|
if (NumConstant.ONE_STR.equals(userInfo.getGender())) { |
|
|
|
gender = "先生"; |
|
|
|
} else if (NumConstant.TWO_STR.equals(userInfo.getGender())) { |
|
|
|
gender = "女士"; |
|
|
|
} else { |
|
|
|
gender = "先生/女士"; |
|
|
|
} |
|
|
|
String leaderName = userInfo.getStreet().concat(StrConstant.HYPHEN).concat(userInfo.getSurname()).concat(gender); |
|
|
|
dto.setLeaderName(leaderName); |
|
|
|
} |
|
|
|
}); |
|
|
|
return recommendGroupList; |
|
|
|
} |
|
|
|