diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java index abd1116256..0d06633106 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java @@ -145,14 +145,16 @@ public class GuideServiceImpl extends BaseServiceImpl imp PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); formDTO.setCustomerId(tokenDto.getCustomerId()); List list = baseDao.getGuideList(formDTO); - list.forEach(item -> { - CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), item.getCreatedId()); - if (null == staffInfoCache) { - item.setCategoryName(""); - } else { - item.setCreatedName(staffInfoCache.getRealName()); - } - }); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), item.getCreatedId()); + if (null == staffInfoCache) { + item.setCategoryName(""); + } else { + item.setCreatedName(staffInfoCache.getRealName()); + } + }); + } PageInfo pageInfo = new PageInfo<>(list); return new PageData<>(list, pageInfo.getTotal()); } @@ -397,14 +399,16 @@ public class GuideServiceImpl extends BaseServiceImpl imp public PageData collectionList(TokenDto tokenDto, PageFormDTO formDTO) { PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); List list = baseDao.getCollectionList(tokenDto); - list.forEach(item -> { - CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), item.getCreatedId()); - if (null == staffInfoCache) { - item.setCategoryName(""); - } else { - item.setCreatedName(staffInfoCache.getRealName()); - } - }); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), item.getCreatedId()); + if (null == staffInfoCache) { + item.setCategoryName(""); + } else { + item.setCreatedName(staffInfoCache.getRealName()); + } + }); + } PageInfo pageInfo = new PageInfo<>(list); return new PageData<>(list, pageInfo.getTotal()); }