diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionDataResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionDataResultDTO.java index 78f77a850b..5f815c7f5c 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionDataResultDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionDataResultDTO.java @@ -15,4 +15,5 @@ public class OptionDataResultDTO implements Serializable { private String label; private String value; private String code; + private String radio; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartVolunteerService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartVolunteerService.java index abccaae1e6..b8e4414f60 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartVolunteerService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartVolunteerService.java @@ -11,5 +11,5 @@ import java.util.List; *@Date 2021/12/8 */ public interface HeartVolunteerService { - List listVolunteersPage(String customerId, Date endCreateTime, Integer pageNum, Integer pageSize); + List listVolunteers(String customerId, Date endCreateTime); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java index c95fd094fe..902a6a8713 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java @@ -29,12 +29,10 @@ public class HeartVolunteerServiceImpl implements HeartVolunteerService { private VolunteerInfoDao volunteerInfoDao; @Override - public List listVolunteersPage(String customerId, Date endCreateTime, Integer pageNum, Integer pageSize) { - return PageHelper.startPage(pageNum, pageSize).doSelectPage(() -> { - LambdaQueryWrapper query = new LambdaQueryWrapper<>(); - query.eq(VolunteerInfoEntity::getCustomerId, customerId); - query.lt(VolunteerInfoEntity::getCreatedTime, endCreateTime); - volunteerInfoDao.selectList(query); - }); + public List listVolunteers(String customerId, Date endCreateTime) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(VolunteerInfoEntity::getCustomerId, customerId); + query.lt(VolunteerInfoEntity::getCreatedTime, endCreateTime); + return volunteerInfoDao.selectList(query); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java index 7782226923..e165e95a75 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java @@ -67,11 +67,12 @@ public class DemandServiceImpl implements DemandService { /** * 清理旧数据 - * @param yestoday + * @param targetDate 要清理哪天的数据 + * @param customerIds 要清理哪些客户的 */ - private void clearOldDatas(List customerIds, Date yestoday) { + private void clearOldDatas(List customerIds, Date targetDate) { - String dateDimId = DimIdGenerator.getDateDimId(yestoday); + String dateDimId = DimIdGenerator.getDateDimId(targetDate); demandStatsService.clearVolunteerDemandServiceDailyStats(customerIds, dateDimId); @@ -90,50 +91,40 @@ public class DemandServiceImpl implements DemandService { // 居民志愿者数量 Integer resiVolunteerCount = 0; + // 党员志愿者用户id列表 List partymemberVolunteerUserIds = new ArrayList<>(16); - int pageNum = 1; - int volunteerPageSize = 5; + List volunteers = heartVolunteerService.listVolunteers(customerId, endTime); - while (true) { - - int shardingStartIndex = 0; - int shardingSize = 2; + volunteerTotalCount = volunteers.size(); - List volunteersPage = heartVolunteerService.listVolunteersPage(customerId, endTime, pageNum, volunteerPageSize); + // 分片开始下标 + int shardingStartIndex = 0; + // 分片大小(条数) + int shardingSize = 2; + + // 分片去确定党员身份,防止in条件过大 + while (true) { + int realShardingSize = Math.min(shardingSize, volunteerTotalCount - shardingStartIndex); - // 如果查询结果为0,说明没有更多的志愿者了 - if (volunteersPage.size() == 0) { + if (realShardingSize <= 0) { break; } - volunteerTotalCount += volunteersPage.size(); - - // 分片去确定党员身份 - while (true) { - int realShardingSize = Math.min(shardingSize, volunteersPage.size() - shardingStartIndex); + int shardingEndIndex = shardingStartIndex + realShardingSize; + List volunteerUserIds = volunteers.subList(shardingStartIndex, shardingEndIndex) + .stream() + .map((volunteerInfoEntity) -> volunteerInfoEntity.getUserId()) + .collect(Collectors.toList()); - if (realShardingSize == 0) { - break; - } - - int shardingEndIndex = shardingStartIndex + realShardingSize; - List volunteerUserIds = volunteersPage.subList(shardingStartIndex, shardingEndIndex) - .stream() - .map((volunteerInfoEntity) -> volunteerInfoEntity.getUserId()) - .collect(Collectors.toList()); - - List tempPartymemberUserIds = userService.filterUserIds(volunteerUserIds, EpmetRoleKeyConstant.PARTYMEMBER); + List tempPartymemberUserIds = userService.filterUserIds(volunteerUserIds, EpmetRoleKeyConstant.PARTYMEMBER); - partymemberVolunteerUserIds.addAll(tempPartymemberUserIds); - - shardingStartIndex = shardingEndIndex; - } + partymemberVolunteerUserIds.addAll(tempPartymemberUserIds); - pageNum++; + shardingStartIndex = shardingEndIndex; } - partymemberVolunteerCount += partymemberVolunteerUserIds.size(); + partymemberVolunteerCount = partymemberVolunteerUserIds.size(); resiVolunteerCount = volunteerTotalCount - partymemberVolunteerCount; //2. 查询志愿者服务次数 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index cd80f55b72..819f7bb94f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -339,7 +339,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId()); + wrapper.and(wp -> wp.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId()).or(). + like(IcPartyActivityEntity::getPids, formDTO.getAgencyId())); wrapper.eq(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyActivityEntity::getServiceMatter, formDTO.getServiceMatter()); wrapper.ge(null != formDTO.getStartTime(),IcPartyActivityEntity::getActivityTime, formDTO.getStartTime()); wrapper.le(null != formDTO.getEndTime(), IcPartyActivityEntity::getActivityTime, formDTO.getEndTime()); diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java index c2dbdb85eb..f63ea2d492 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java @@ -1,8 +1,10 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * @Author zxc @@ -49,4 +51,6 @@ public class IssueResultDTO implements Serializable { */ private String gridName; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date shiftIssueTime; } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 6835ce4b4b..f433bd60ed 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -1588,11 +1588,12 @@ public class IssueServiceImpl extends BaseServiceImpl imp } // 分类编码长度 Integer length = baseDao.selectOneLevelCategoryLength(tokenDto.getCustomerId()); - PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectIssueLimit50(formDTO.getOrgId(), formDTO.getOrgType(), formDTO.getStatus(),length)); - List list = pageInfo.getList(); - if (CollectionUtils.isEmpty(list)){ + List allList = baseDao.selectIssueLimit50(formDTO.getOrgId(), formDTO.getOrgType(), formDTO.getStatus(), length); + if (CollectionUtils.isEmpty(allList)){ return new ResiBuzzResultDTO(); } + List list = allList.stream().skip(formDTO.getPageSize() * (formDTO.getPageNo() - NumConstant.ONE)) + .limit(formDTO.getPageSize()).collect(Collectors.toList()); AtomicReference no = new AtomicReference<>((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize() + NumConstant.ONE); ResiBuzzResultDTO result = new ResiBuzzResultDTO(); UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO(); @@ -1602,8 +1603,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp throw new EpmetException("查询人员姓名失败..."); } // 默认最多50 产品要求 - Integer total = pageInfo.getSize(); - result.setTotal(total > NumConstant.FIFTY ? NumConstant.FIFTY : total); + result.setTotal(allList.size()); // 赋值展示名字 list.forEach(l -> { l.setSort(no.getAndSet(no.get() + NumConstant.ONE)); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.15__add_colour.sql b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.15__add_color.sql similarity index 100% rename from epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.15__add_colour.sql rename to epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.15__add_color.sql diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index d955db65ef..3d1d2bde61 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -36,7 +36,8 @@ issue_status AS issueStatus, suggestion AS issueSuggestion, grid_id AS gridId, - created_by AS userId + created_by AS userId, + CREATED_TIME as shiftIssueTime FROM issue WHERE @@ -622,7 +623,7 @@ AND i.ORG_ID_PATH LIKE CONCAT('%',#{orgId}) - ORDER BY (s.SUPPORT_COUNT + s.OPPOSITION_COUNT) DESC,i.created_time DESC + ORDER BY (s.SUPPORT_COUNT + s.OPPOSITION_COUNT) DESC,i.created_time DESC LIMIT 50 diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml index 2188bf2ea5..06c1fc0000 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml @@ -251,7 +251,7 @@ CATEGORY_CODE, CATEGORY_NAME, LENGTH(CATEGORY_CODE) AS codeLength, - IFNULL(color,'') AS colour + IFNULL(color,'') AS color FROM issue_project_category_dict WHERE DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryListDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryListDTO.java index a32b7125ea..8003cdfd0b 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryListDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryListDTO.java @@ -25,6 +25,8 @@ public class CategoryListDTO implements Serializable { */ private String categoryName; + private String color; + /** * 个数 */ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java index 2bce88383f..9af69706cd 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.resi.group.dto.topic.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -90,4 +91,6 @@ public class ResiTopicIncludeIssueDetailResultDTO implements Serializable { * 话题被屏蔽详情 */ private TopicHiddenDetailDTO hiddenDetail; + + private String gridName; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index d5e6d7500b..e462289cb7 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -885,6 +885,15 @@ public class ResiTopicServiceImpl extends BaseServiceImpl gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + if(gridInfoRes.success()&&null!=gridInfoRes.getData()){ + resultDTO.setGridName(gridInfoRes.getData().getGridNamePath()); + } + } //2.查询话题附件 QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueDetailResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueDetailResultDTO.java index 295522ae79..69ebc4476c 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueDetailResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueDetailResultDTO.java @@ -1,9 +1,11 @@ package com.epmet.dto.result; import com.epmet.dto.TopicInfoDTO; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * @Author zxc @@ -74,4 +76,7 @@ public class IssueDetailResultDTO implements Serializable { * 态度 - opposition(反对)support(赞成) */ private String attitude; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date shiftIssueTime; } diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java index b278b9f585..e1360eb01b 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java @@ -1,8 +1,10 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * @Author zxc @@ -44,5 +46,7 @@ public class IssueResultDTO implements Serializable { */ private String topicId; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date shiftIssueTime; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerDistributionResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerDistributionResultDTO.java index c1bb3d866c..94a4d4ac88 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerDistributionResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerDistributionResultDTO.java @@ -27,7 +27,7 @@ public class VolunteerDistributionResultDTO { @Data public static class Distribution { - private Set volunteerTypes; + private Set volunteerCategories; private String epmetUserId; private String icResiUserId; private String longitude; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index cf10024449..2fad36a652 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -70,6 +70,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.sql.Date; import java.sql.Timestamp; import java.util.*; @@ -972,17 +974,28 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> dictResult = epmetAdminOpenFeignClient.dictList(dictFormDTO); Map map = new HashMap<>(); + int total = 0; //统计组织下各年龄范围人数 List list = baseDao.getPartyMemberAgeStatistics(formDTO.getOrgType(), formDTO.getOrgId()); if (CollectionUtils.isNotEmpty(list)) { map = list.stream().collect(Collectors.toMap(OptionDataResultDTO::getCode, OptionDataResultDTO::getValue)); + total = list.stream().mapToInt(item -> Integer.parseInt(item.getValue())).sum(); } Map finalMap = map; + int finalTotal = total; return dictResult.getData().stream().map(item -> { OptionDataResultDTO dto = new OptionDataResultDTO(); dto.setCode(item.getValue()); dto.setLabel(item.getLabel()); dto.setValue(null == finalMap.get(item.getValue())?NumConstant.ZERO_STR:finalMap.get(item.getValue())); + BigDecimal radio = new BigDecimal("0.00"); + if (NumConstant.ZERO != finalTotal) { + BigDecimal sum = new BigDecimal(finalTotal); + BigDecimal count = new BigDecimal(dto.getValue()); + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + radio = count.multiply(hundred).divide(sum, NumConstant.TWO, RoundingMode.HALF_UP); + } + dto.setRadio(radio.stripTrailingZeros().toString().concat("%")); return dto; }).collect(Collectors.toList()); } @@ -1022,15 +1035,26 @@ public class IcResiUserServiceImpl extends BaseServiceImpl map = new HashMap<>(); //统计组织下文化程度党员人数 List list = baseDao.getPartyMemberEducationStatistics(formDTO.getOrgType(), formDTO.getOrgId()); + int total = 0; if (CollectionUtils.isNotEmpty(list)) { map = list.stream().collect(Collectors.toMap(OptionDataResultDTO::getCode, OptionDataResultDTO::getValue)); + total = list.stream().mapToInt(item -> Integer.parseInt(item.getValue())).sum(); } Map finalMap = map; + int finalTotal = total; return dictResult.getData().stream().map(item -> { OptionDataResultDTO dto = new OptionDataResultDTO(); dto.setCode(item.getValue()); dto.setLabel(item.getLabel()); dto.setValue(null == finalMap.get(item.getValue())?NumConstant.ZERO_STR:finalMap.get(item.getValue())); + BigDecimal radio = new BigDecimal("0.00"); + if (NumConstant.ZERO != finalTotal) { + BigDecimal sum = new BigDecimal(finalTotal); + BigDecimal count = new BigDecimal(dto.getValue()); + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + radio = count.multiply(hundred).divide(sum, NumConstant.TWO, RoundingMode.HALF_UP); + } + dto.setRadio(radio.stripTrailingZeros().toString().concat("%")); return dto; }).collect(Collectors.toList()); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java index f0e2796a98..d259315211 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java @@ -162,7 +162,7 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); - distribution.setVolunteerTypes(volunteerTypes); + distribution.setVolunteerCategories(volunteerTypes); distribution.setEpmetUserId(userBaseInfo.getUserId()); distribution.setIcResiUserId(icResiUserInfo.getId()); Optional.of(building).ifPresent(b -> {