package cn.fw.valhalla.service.report; import cn.fw.common.cache.locker.DistributedLocker; import cn.fw.valhalla.domain.db.PublicReportData; import cn.fw.valhalla.domain.dto.*; import cn.fw.valhalla.domain.enums.PubStandType; import cn.fw.valhalla.domain.enums.StammkundeSourcesEnum; import cn.fw.valhalla.domain.enums.ValhallaReportDimension; import cn.fw.valhalla.service.data.PubCluePoolService; import cn.fw.valhalla.service.data.PublicPoolService; import cn.fw.valhalla.service.data.PublicReportDataService; import cn.fw.valhalla.service.data.StammkundePoolService; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Sets; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.redisson.api.RLock; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.temporal.TemporalAdjusters; import java.util.*; import java.util.stream.Collectors; /** * 公共池报表数据服务 * * @author : kurisu * @version : 2.0 * @className : PublicReportBizService * @description : 公共池报表数据服务 * @date : 2023-05-04 15:07 */ @Service @Slf4j @RequiredArgsConstructor public class PublicReportBizService { private final DistributedLocker distributedLocker; private final PublicReportDataService publicReportDataService; private final PubCluePoolService pubCluePoolService; private final StammkundePoolService stammkundePoolService; private final PublicPoolService publicPoolService; @Value("${spring.cache.custom.global-prefix}:PublicReport:extracting") @Getter private String keyPrefix; /** * 抽取集团公共池数据 * * @param nowDate 日期 * @param groupId 集团id */ @Transactional(rollbackFor = Exception.class) public void extracting(final LocalDate nowDate, final Long groupId) { log.info("开始抽取公共池报表数据,日期:{} 集团:{}", nowDate, groupId); final String lockKey = generateKey(groupId); RLock lock = (RLock) distributedLocker.lock(lockKey); if (lock == null || !lock.isLocked()) { return; } try { /** * 1.准备数据 */ HashSet sourceTypes = Sets.newHashSet(PubStandType.PUB.getValue(), PubStandType.ACTIVITY.getValue()); HashSet sourceSets = Sets.newHashSet(StammkundeSourcesEnum.NATURAL.getValue()); //开始时间 LocalDateTime startDayDateTime = nowDate.atTime(0, 0, 0); //结束时间 LocalDateTime endDayDateTime = nowDate.atTime(23, 59, 59); //月初日期 LocalDate startMonDate = nowDate.with(TemporalAdjusters.firstDayOfMonth()); //月初时间 LocalDateTime startMonDateTime = startMonDate.atTime(0,0,0); //月初的截止结束时间 = 月初的上一天的23:59:59 LocalDateTime startMonDateTimeOver = startMonDate.minusDays(1).atTime(23, 59, 59); /** * 1.1 查询日站岗分配(人) */ List cluePoolDayList = getCluePoolTimeList(groupId, sourceTypes, startDayDateTime, endDayDateTime); /** * 1.2 查询月站岗分配(人) */ List cluePoolMonList = getCluePoolTimeList(groupId, sourceTypes,startMonDateTime, endDayDateTime); /** * 1.3 查询日自然到店成交(人) */ List stammkundePoolReportDayList = getStammkundePoolReportTimeList(groupId, startDayDateTime, endDayDateTime, sourceSets); /** * 1.4 查询月自然到店成交(人) */ List stammkundePoolReportMonList = getStammkundePoolReportTimeList(groupId, startMonDateTime,endDayDateTime, sourceSets); /** * 1.5 查询日新增(来源) */ List poolReportDayDTOList = getPoolReportList(groupId, startDayDateTime, endDayDateTime); /** * 1.6 查询月新增(来源) */ List poolReportMonDTOList = getPoolReportList(groupId, startMonDateTime, endDayDateTime); /** * 1.7 截止当前(来源) */ List poolReportCutDTOList = getPoolReportList(groupId,null, endDayDateTime); /** * 1.8 月初始数(来源) */ List poolReportMonFirstDTOList = getPoolReportMonFirstDTOList(nowDate,startMonDate, groupId, startMonDateTimeOver); /** * 2.处理数据 */ /** * 2.1 人员维度 */ List publicReportDataD20List = extractedD20(nowDate, groupId, cluePoolDayList, cluePoolMonList, stammkundePoolReportDayList, stammkundePoolReportMonList); /** * 2.2 来源维度 */ List publicReportDataD99List = extractedD99(nowDate, groupId, poolReportDayDTOList, poolReportMonDTOList, poolReportCutDTOList, poolReportMonFirstDTOList); /** * 2.3 门店维度 = 来源 + 人员 */ List publicReportDataD10List = extractedD10(nowDate, groupId, publicReportDataD20List, publicReportDataD99List); /** * 3.存储数据 */ /** * 3.1 清理旧数据 */ delNowDate(nowDate); /** * 3.2 存储新数据 */ save(publicReportDataD20List, publicReportDataD99List, publicReportDataD10List); } finally { if (lock.isLocked()) { lock.unlock(); } } } /** * 获取月初的数据 * @param nowDate * @param startMonDate * @param groupId * @param startMonDateTimeOver * @return */ private List getPoolReportMonFirstDTOList(LocalDate nowDate,LocalDate startMonDate, Long groupId, LocalDateTime startMonDateTimeOver) { List poolReportMonFirstDTOList = new ArrayList<>(); if (nowDate.equals(startMonDate)) { //如果是月初一就去查询小于月初一的数据统计 poolReportMonFirstDTOList = getPoolReportList(groupId,null, startMonDateTimeOver); }else { //不是1号的数据直接从上次抽取的数据中查询月初一的数据 List reportDataList = publicReportDataService.list(Wrappers.lambdaQuery() .eq(PublicReportData::getReportDimension, ValhallaReportDimension.D60.getValue()) .eq(PublicReportData::getDataDate, startMonDate) ); if (!CollectionUtils.isEmpty(reportDataList)){ for (PublicReportData publicReportData : reportDataList) { PublicPoolReportDTO publicPoolReportDTO = new PublicPoolReportDTO(); publicPoolReportDTO.setType(publicReportData.getType()); publicPoolReportDTO.setShopId(publicReportData.getShopId()); publicPoolReportDTO.setShopName(publicReportData.getShopName()); if (Objects.nonNull(publicReportData.getMonthInitial())){ publicPoolReportDTO.setTotal(publicReportData.getMonthInitial().longValue()); } poolReportMonFirstDTOList.add(publicPoolReportDTO); } } } return poolReportMonFirstDTOList; } /** * 查询指定时间 * @param groupId * @param startDayDateTime * @param endDayDateTime * @return */ private List getPoolReportList(Long groupId,LocalDateTime startDayDateTime,LocalDateTime endDayDateTime){ PublicPoolReportQueryDTO publicPoolReportQueryDayDTO = new PublicPoolReportQueryDTO(groupId); publicPoolReportQueryDayDTO.setStartDate(startDayDateTime); publicPoolReportQueryDayDTO.setEndDate(endDayDateTime); return publicPoolService.countPublicPoolList(publicPoolReportQueryDayDTO); } /** * 1.3 查询指定时间自然到店成交(人) * @param groupId * @param startDayDateTime * @param endDayDateTime * @param sourceSets * @return */ private List getStammkundePoolReportTimeList(Long groupId, LocalDateTime startDayDateTime, LocalDateTime endDayDateTime, HashSet sourceSets) { StammkundePoolReportQueryDTO stammkundePoolReportQueryDayDTO = new StammkundePoolReportQueryDTO(groupId); stammkundePoolReportQueryDayDTO.setStartDate(startDayDateTime); stammkundePoolReportQueryDayDTO.setEndDate(endDayDateTime); stammkundePoolReportQueryDayDTO.setSourceSets(sourceSets); return stammkundePoolService.countStammkundePoolList(stammkundePoolReportQueryDayDTO); } /** * 1.1 查询指定时间站岗分配(人) * @param groupId * @param sourceTypes * @param startDayDateTime * @param endDayDateTime * @return */ private List getCluePoolTimeList(Long groupId, HashSet sourceTypes, LocalDateTime startDayDateTime, LocalDateTime endDayDateTime) { PubCluePoolReportQueryDTO reportQueryDayDTO = new PubCluePoolReportQueryDTO(groupId); reportQueryDayDTO.setStartDate(startDayDateTime); reportQueryDayDTO.setEndDate(endDayDateTime); reportQueryDayDTO.setSourceTypes(sourceTypes); return pubCluePoolService.countPubCluePoolList(reportQueryDayDTO); } /** * 3.1 清理旧数据 * @param nowDate */ private void delNowDate(LocalDate nowDate) { publicReportDataService.remove(Wrappers.lambdaUpdate() .eq(PublicReportData::getDataDate, nowDate) ); } /** * 3.2 存储新数据 * @param publicReportDataD20List 人员的 * @param publicReportDataD99List 来源的 * @param publicReportDataD10List 店的 */ private void save(List publicReportDataD20List, List publicReportDataD99List, List publicReportDataD10List) { if (!CollectionUtils.isEmpty(publicReportDataD20List)){ for (PublicReportData reportData : publicReportDataD20List) { dealDefaultValueD20(reportData); } publicReportDataService.saveBatch(publicReportDataD20List); } if (!CollectionUtils.isEmpty(publicReportDataD99List)){ for (PublicReportData reportData : publicReportDataD99List) { dealDefaultValueD99(reportData); } publicReportDataService.saveBatch(publicReportDataD99List); } if (!CollectionUtils.isEmpty(publicReportDataD10List)){ for (PublicReportData reportData : publicReportDataD10List) { //店的默认值处理,共8个 = 人的+店的 dealDefaultValueD20(reportData); dealDefaultValueD99(reportData); } publicReportDataService.saveBatch(publicReportDataD10List); } } /** * 来源的默认值处理,共4个 * @param reportData */ private static void dealDefaultValueD99(PublicReportData reportData) { if (Objects.isNull(reportData.getMonthInitial())){ reportData.setMonthInitial(0); } if (Objects.isNull(reportData.getDayIncrease())){ reportData.setDayIncrease(0); } if (Objects.isNull(reportData.getMonthIncrease())){ reportData.setMonthIncrease(0); } if (Objects.isNull(reportData.getCurrentQuantity())){ reportData.setCurrentQuantity(0); } } /** * 人员的默认值处理,共4个 * @param reportData */ private static void dealDefaultValueD20(PublicReportData reportData) { //人员的默认值处理,共4个 if (Objects.isNull(reportData.getDayStandQuantity())){ reportData.setDayStandQuantity(0); } if (Objects.isNull(reportData.getMonthStandQuantity())){ reportData.setMonthStandQuantity(0); } if (Objects.isNull(reportData.getDayNaturalQuantity())){ reportData.setDayNaturalQuantity(0); } if (Objects.isNull(reportData.getMonthNaturalQuantity())){ reportData.setMonthNaturalQuantity(0); } } /** * 处理门店维度的数据 * @param nowDate * @param groupId * @param publicReportDataD20List * @param publicReportDataD99List * @return */ private List extractedD10(LocalDate nowDate, Long groupId, List publicReportDataD20List, List publicReportDataD99List) { List publicReportData10List = new ArrayList<>(); if (!CollectionUtils.isEmpty(publicReportDataD20List)){ Map> shopIdListMap = publicReportDataD20List.stream().collect(Collectors.groupingBy(PublicReportData::getShopId)); shopIdListMap.forEach((shopId,shopList) -> { PublicReportData publicReportData = getPublicReportDataD10(publicReportData10List, shopId, groupId); publicReportData.setDataDate(nowDate); publicReportData.setShopId(shopId); if (StringUtils.isEmpty(publicReportData.getShopName())){ publicReportData.setShopName(Objects.nonNull(shopList.get(0)) ? shopList.get(0).getShopName():null); } publicReportData.setDayStandQuantity(shopList.stream().filter(e -> Objects.nonNull(e.getDayStandQuantity())).mapToInt(PublicReportData :: getDayStandQuantity).sum()); publicReportData.setMonthStandQuantity(shopList.stream().filter(e -> Objects.nonNull(e.getMonthStandQuantity())).mapToInt(PublicReportData :: getMonthStandQuantity).sum()); publicReportData.setDayNaturalQuantity(shopList.stream().filter(e -> Objects.nonNull(e.getDayNaturalQuantity())).mapToInt(PublicReportData :: getDayNaturalQuantity).sum()); publicReportData.setMonthNaturalQuantity(shopList.stream().filter(e -> Objects.nonNull(e.getMonthNaturalQuantity())).mapToInt(PublicReportData :: getMonthNaturalQuantity).sum()); publicReportData.setCreateTime(new Date()); publicReportData.setUpdateTime(publicReportData.getCreateTime()); if (!publicReportData10List.contains(publicReportData)){ publicReportData10List.add(publicReportData); } }); } if (!CollectionUtils.isEmpty(publicReportDataD99List)){ Map> shopIdListMap = publicReportDataD99List.stream().collect(Collectors.groupingBy(PublicReportData::getShopId)); shopIdListMap.forEach((shopId,shopList) -> { PublicReportData publicReportData = getPublicReportDataD10(publicReportData10List, shopId, groupId); publicReportData.setDataDate(nowDate); publicReportData.setShopId(shopId); if (StringUtils.isEmpty(publicReportData.getShopName())){ publicReportData.setShopName(Objects.nonNull(shopList.get(0)) ? shopList.get(0).getShopName():null); } publicReportData.setDayIncrease(shopList.stream().filter(e -> Objects.nonNull(e.getDayIncrease())).mapToInt(PublicReportData :: getDayIncrease).sum()); publicReportData.setMonthIncrease(shopList.stream().filter(e -> Objects.nonNull(e.getMonthIncrease())).mapToInt(PublicReportData :: getMonthIncrease).sum()); publicReportData.setCurrentQuantity(shopList.stream().filter(e -> Objects.nonNull(e.getCurrentQuantity())).mapToInt(PublicReportData :: getCurrentQuantity).sum()); publicReportData.setMonthInitial(shopList.stream().filter(e -> Objects.nonNull(e.getMonthInitial())).mapToInt(PublicReportData :: getMonthInitial).sum()); publicReportData.setCreateTime(new Date()); publicReportData.setUpdateTime(publicReportData.getCreateTime()); if (!publicReportData10List.contains(publicReportData)){ publicReportData10List.add(publicReportData); } }); } return publicReportData10List; } /** * 处理来源维度的数据 * @param nowDate * @param groupId * @param poolReportDayDTOList * @param poolReportMonDTOList * @param poolReportCutDTOList * @param poolReportMonFirstDTOList */ private List extractedD99(LocalDate nowDate, Long groupId, List poolReportDayDTOList, List poolReportMonDTOList, List poolReportCutDTOList, List poolReportMonFirstDTOList) { List publicReportData99List = new ArrayList<>(); if (!CollectionUtils.isEmpty(poolReportDayDTOList)){ for (PublicPoolReportDTO publicPoolReportDTO : poolReportDayDTOList) { PublicReportData publicReportData = getPublicReportDataD99Increase(publicReportData99List, publicPoolReportDTO, groupId); publicReportData.setDataDate(nowDate); publicReportData.setShopId(publicPoolReportDTO.getShopId()); if (StringUtils.isEmpty(publicReportData.getShopName())){ publicReportData.setShopName(publicPoolReportDTO.getShopName()); } publicReportData.setDayIncrease(publicPoolReportDTO.getTotal().intValue()); publicReportData.setType(publicPoolReportDTO.getType()); publicReportData.setCreateTime(new Date()); publicReportData.setUpdateTime(publicReportData.getCreateTime()); if (!publicReportData99List.contains(publicReportData)){ publicReportData99List.add(publicReportData); } } } if (!CollectionUtils.isEmpty(poolReportMonDTOList)){ for (PublicPoolReportDTO publicPoolReportDTO : poolReportMonDTOList) { PublicReportData publicReportData = getPublicReportDataD99Increase(publicReportData99List, publicPoolReportDTO, groupId); publicReportData.setDataDate(nowDate); publicReportData.setShopId(publicPoolReportDTO.getShopId()); if (StringUtils.isEmpty(publicReportData.getShopName())){ publicReportData.setShopName(publicPoolReportDTO.getShopName()); } publicReportData.setMonthIncrease(publicPoolReportDTO.getTotal().intValue()); publicReportData.setType(publicPoolReportDTO.getType()); publicReportData.setCreateTime(new Date()); publicReportData.setUpdateTime(publicReportData.getCreateTime()); if (!publicReportData99List.contains(publicReportData)){ publicReportData99List.add(publicReportData); } } } if (!CollectionUtils.isEmpty(poolReportCutDTOList)){ for (PublicPoolReportDTO publicPoolReportDTO : poolReportCutDTOList) { PublicReportData publicReportData = getPublicReportDataD99Increase(publicReportData99List, publicPoolReportDTO, groupId); publicReportData.setDataDate(nowDate); publicReportData.setShopId(publicPoolReportDTO.getShopId()); if (StringUtils.isEmpty(publicReportData.getShopName())){ publicReportData.setShopName(publicPoolReportDTO.getShopName()); } publicReportData.setCurrentQuantity(publicPoolReportDTO.getTotal().intValue()); publicReportData.setType(publicPoolReportDTO.getType()); publicReportData.setCreateTime(new Date()); publicReportData.setUpdateTime(publicReportData.getCreateTime()); if (!publicReportData99List.contains(publicReportData)){ publicReportData99List.add(publicReportData); } } } if (!CollectionUtils.isEmpty(poolReportMonFirstDTOList)){ for (PublicPoolReportDTO publicPoolReportDTO : poolReportMonFirstDTOList) { PublicReportData publicReportData = getPublicReportDataD99Increase(publicReportData99List, publicPoolReportDTO, groupId); publicReportData.setDataDate(nowDate); publicReportData.setShopId(publicPoolReportDTO.getShopId()); if (StringUtils.isEmpty(publicReportData.getShopName())){ publicReportData.setShopName(publicPoolReportDTO.getShopName()); } publicReportData.setMonthInitial(publicPoolReportDTO.getTotal().intValue()); publicReportData.setType(publicPoolReportDTO.getType()); publicReportData.setCreateTime(new Date()); publicReportData.setUpdateTime(publicReportData.getCreateTime()); if (!publicReportData99List.contains(publicReportData)){ publicReportData99List.add(publicReportData); } } } return publicReportData99List; } /** * 处理人员维度的数据 * @param nowDate * @param groupId * @param cluePoolDayList * @param cluePoolMonList * @param stammkundePoolReportDayDTOS * @param stammkundePoolReportMonDTOS */ private List extractedD20(LocalDate nowDate, Long groupId, List cluePoolDayList, List cluePoolMonList, List stammkundePoolReportDayDTOS, List stammkundePoolReportMonDTOS) { List publicReportData20List = new ArrayList<>(); if (!CollectionUtils.isEmpty(cluePoolDayList)){ for (PubCluePoolReportDTO pubCluePoolReportDTO : cluePoolDayList) { PublicReportData data = getPublicReportDataD20Stand(publicReportData20List, pubCluePoolReportDTO, groupId); data.setDataDate(nowDate); data.setUserId(pubCluePoolReportDTO.getAdviserId()); data.setUserName(pubCluePoolReportDTO.getAdviserName()); data.setShopId(pubCluePoolReportDTO.getShopId()); if (StringUtils.isEmpty(data.getShopName())){ data.setShopName(pubCluePoolReportDTO.getShopName()); } data.setDayStandQuantity(pubCluePoolReportDTO.getTotal().intValue()); data.setCreateTime(new Date()); data.setUpdateTime(data.getCreateTime()); if (!publicReportData20List.contains(data)){ publicReportData20List.add(data); } } } if (!CollectionUtils.isEmpty(cluePoolMonList)){ for (PubCluePoolReportDTO pubCluePoolReportDTO : cluePoolMonList) { PublicReportData data = getPublicReportDataD20Stand(publicReportData20List, pubCluePoolReportDTO, groupId); data.setDataDate(nowDate); data.setUserId(pubCluePoolReportDTO.getAdviserId()); data.setUserName(pubCluePoolReportDTO.getAdviserName()); data.setShopId(pubCluePoolReportDTO.getShopId()); if (StringUtils.isEmpty(data.getShopName())){ data.setShopName(pubCluePoolReportDTO.getShopName()); } data.setMonthStandQuantity((pubCluePoolReportDTO.getTotal().intValue())); data.setCreateTime(new Date()); data.setUpdateTime(data.getCreateTime()); if (!publicReportData20List.contains(data)){ publicReportData20List.add(data); } } } if (!CollectionUtils.isEmpty(stammkundePoolReportDayDTOS)){ for (StammkundePoolReportDTO stammkundePoolReportDTO : stammkundePoolReportDayDTOS) { PublicReportData data = getPublicReportDataD20Natural(publicReportData20List, stammkundePoolReportDTO, groupId); data.setDataDate(nowDate); data.setUserId(stammkundePoolReportDTO.getAdviserId()); data.setUserName(stammkundePoolReportDTO.getAdviserName()); data.setShopId(stammkundePoolReportDTO.getShopId()); data.setDayNaturalQuantity((stammkundePoolReportDTO.getTotal().intValue())); data.setCreateTime(new Date()); data.setUpdateTime(new Date()); if (!publicReportData20List.contains(data)){ publicReportData20List.add(data); } } } if (!CollectionUtils.isEmpty(stammkundePoolReportMonDTOS)){ for (StammkundePoolReportDTO stammkundePoolReportDTO : stammkundePoolReportMonDTOS) { PublicReportData data = getPublicReportDataD20Natural(publicReportData20List, stammkundePoolReportDTO, groupId); data.setDataDate(nowDate); data.setUserId(stammkundePoolReportDTO.getAdviserId()); data.setUserName(stammkundePoolReportDTO.getAdviserName()); data.setShopId(stammkundePoolReportDTO.getShopId()); data.setMonthNaturalQuantity((stammkundePoolReportDTO.getTotal().intValue())); data.setCreateTime(new Date()); data.setUpdateTime(new Date()); if (!publicReportData20List.contains(data)){ publicReportData20List.add(data); } } } return publicReportData20List; } private PublicReportData getPublicReportDataD20Stand(List publicReportData20List,PubCluePoolReportDTO pubCluePoolReportDTO,Long groupId){ if (CollectionUtils.isEmpty(publicReportData20List)){ return new PublicReportData(ValhallaReportDimension.D20.getValue(),groupId); } Optional dataOptional = publicReportData20List.stream().filter(e -> pubCluePoolReportDTO.getAdviserId().equals(e.getUserId()) && pubCluePoolReportDTO.getShopId().equals(e.getShopId())).findFirst(); if (dataOptional.isPresent()){ return dataOptional.get(); } return new PublicReportData(ValhallaReportDimension.D20.getValue(),groupId); } private PublicReportData getPublicReportDataD20Natural(List publicReportData20List,StammkundePoolReportDTO stammkundePoolReportMonDTO,Long groupId){ if (CollectionUtils.isEmpty(publicReportData20List)){ return new PublicReportData(ValhallaReportDimension.D20.getValue(),groupId); } Optional dataOptional = publicReportData20List.stream().filter(e -> stammkundePoolReportMonDTO.getAdviserId().equals(e.getUserId()) && stammkundePoolReportMonDTO.getShopId().equals(e.getShopId())).findFirst(); if (dataOptional.isPresent()){ return dataOptional.get(); } return new PublicReportData(ValhallaReportDimension.D20.getValue(),groupId); } private PublicReportData getPublicReportDataD99Increase(List publicReportData20List,PublicPoolReportDTO publicPoolReportDTO,Long groupId){ if (CollectionUtils.isEmpty(publicReportData20List)){ return new PublicReportData(ValhallaReportDimension.D60.getValue(),groupId); } Optional dataOptional = publicReportData20List.stream().filter(e -> publicPoolReportDTO.getType().equals(e.getType()) && publicPoolReportDTO.getShopId().equals(e.getShopId())).findFirst(); if (dataOptional.isPresent()){ return dataOptional.get(); } return new PublicReportData(ValhallaReportDimension.D60.getValue(),groupId); } private PublicReportData getPublicReportDataD10(List publicReportData20List,Long shopId,Long groupId){ if (CollectionUtils.isEmpty(publicReportData20List)){ return new PublicReportData(ValhallaReportDimension.D10.getValue(),groupId); } Optional dataOptional = publicReportData20List.stream().filter(e -> shopId.equals(e.getShopId())).findFirst(); if (dataOptional.isPresent()){ return dataOptional.get(); } return new PublicReportData(ValhallaReportDimension.D10.getValue(),groupId); } private String generateKey(final Long groupId) { Assert.notNull(groupId, "groupId cannot be null"); return String.format("%s:%s", getKeyPrefix(), groupId); } }