|
|
@@ -792,6 +792,7 @@ public class LifeUserDynamicsService extends ServiceImpl<LifeUserDynamicsMapper,
|
|
|
blacklist.getBlockerPhoneId()
|
|
|
).filter(Objects::nonNull)) // 过滤null
|
|
|
.collect(Collectors.toSet());
|
|
|
+ List<String> storeUserIdList = new ArrayList<>();
|
|
|
if (!CollectionUtils.isEmpty(lifeUserDynamicsVos)){
|
|
|
for (LifeUserDynamicsVo lifeUserDynamicsVo : lifeUserDynamicsVos) {
|
|
|
dynamicsIdentityHelper.ensureVoLegacyPhoneId(lifeUserDynamicsVo);
|
|
|
@@ -808,9 +809,13 @@ public class LifeUserDynamicsService extends ServiceImpl<LifeUserDynamicsMapper,
|
|
|
StoreInfo storeInfo = storeInfoMapper.getStoreNameByPhone(su.getPhone());
|
|
|
if (storeInfo != null) {
|
|
|
lifeUserDynamicsVo.setStoreName(storeInfo.getStoreName());
|
|
|
- lifeUserDynamicsVo.setBusinessSection(storeInfo.getBusinessSection().toString());
|
|
|
+ if (storeInfo.getBusinessSection() != null) {
|
|
|
+ lifeUserDynamicsVo.setBusinessSection(storeInfo.getBusinessSection().toString());
|
|
|
+ }
|
|
|
lifeUserDynamicsVo.setBusinessTypeName(storeInfo.getBusinessTypeName());
|
|
|
lifeUserDynamicsVo.setStoreUserId(storeInfo.getId().toString());
|
|
|
+ lifeUserDynamicsVo.setScoreAvg(storeInfo.getScoreAvg() != null ? storeInfo.getScoreAvg() : 0.0);
|
|
|
+ storeUserIdList.add(storeInfo.getId().toString());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -825,6 +830,17 @@ public class LifeUserDynamicsService extends ServiceImpl<LifeUserDynamicsMapper,
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ Map<String, Integer> ratingCountMap = batchGetRatingCount(storeUserIdList);
|
|
|
+ for (LifeUserDynamicsVo lifeUserDynamicsVo : lifeUserDynamicsVos) {
|
|
|
+ if ("2".equals(lifeUserDynamicsVo.getType())) {
|
|
|
+ String storeUserId = lifeUserDynamicsVo.getStoreUserId();
|
|
|
+ int ratingCnt = storeUserId != null ? ratingCountMap.getOrDefault(storeUserId, 0) : 0;
|
|
|
+ lifeUserDynamicsVo.setRatingCount(String.valueOf(ratingCnt));
|
|
|
+ if (lifeUserDynamicsVo.getScoreAvg() == null) {
|
|
|
+ lifeUserDynamicsVo.setScoreAvg(0.0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return lifeUserDynamicsVos;
|
|
|
}
|