From 8d2d25be2e49e7c6c3ecc5548e3e7d3db21486cc Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 27 Dec 2021 17:54:19 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IssueVoteStatisticalServiceImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java index b78896b90c..410be46673 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java @@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; @@ -226,7 +227,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl data = issueSatisfactionDetailDao.evaluationList(formDTO); - if (data.size() == NumConstant.ZERO || data == null) { + if (data == null || data.size() == NumConstant.ZERO ) { return new ArrayList<>(); } //获取头像和昵称 eg:山东路168号-周先生 @@ -237,14 +238,13 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl resultList = data.stream().flatMap(evaluation -> userResiInfoList.stream().filter(user -> + return data.stream().flatMap(evaluation -> userResiInfoList.stream().filter(user -> evaluation.getUserId().equals(user.getUserId())).map(userInfo -> { EvaluationListResultDTO resultDTO = ConvertUtils.sourceToTarget(evaluation, EvaluationListResultDTO.class); - resultDTO.setUserNickName(null == userInfo.getShowName() ? "" : userInfo.getShowName()); - resultDTO.setUserHeadPhoto(null == userInfo.getHeadPhoto() ? "" : userInfo.getHeadPhoto()); + resultDTO.setUserNickName(null == userInfo.getShowName() ? StrConstant.EPMETY_STR : userInfo.getShowName()); + resultDTO.setUserHeadPhoto(null == userInfo.getHeadPhoto() ? StrConstant.EPMETY_STR : userInfo.getHeadPhoto()); return resultDTO; })).collect(Collectors.toList()); - return resultList; } /** @@ -283,7 +283,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl statisticalList = baseDao.selectListByIds(ids); if (null != statisticalList && statisticalList.size() > NumConstant.ZERO) { - List statisiticalIds = statisticalList.stream().map(vote -> vote.getIssueId()).collect(Collectors.toList()); + List statisiticalIds = statisticalList.stream().map(IssueVoteStatisticalDTO::getIssueId).collect(Collectors.toList()); if (ids.size() > statisiticalIds.size()) { //差集 From ddf2ac2ff8520e5f2adc98e179aef537e182230a Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 27 Dec 2021 17:54:52 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java index 410be46673..5ee3f6c8d8 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java @@ -563,7 +563,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl Date: Mon, 27 Dec 2021 18:02:59 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E5=87=BA=E7=9A=84=20=E9=AB=98=E7=BA=A7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/epmettduck/impl/PrUserProjectServiceImpl.java | 4 ++-- .../dataaggre/service/impl/QuestionnaireServiceImpl.java | 1 + .../com/epmet/utils/externalapp/ExtAppJwtAuthProcessor.java | 1 + .../epmet/service/impl/ComponentVerifyTicketServiceImpl.java | 1 + .../com/epmet/service/impl/BlockChainUploadServiceImpl.java | 5 +++-- .../java/com/epmet/service/impl/ResiEventServiceImpl.java | 3 ++- .../notice/service/impl/NoticeCommentServiceImpl.java | 3 ++- .../com/epmet/handler/ExcelDiceAddressListHandlerImpl.java | 1 + .../java/com/epmet/service/impl/VolunteerServiceImpl.java | 2 +- 9 files changed, 14 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java index a77e2be2ad..a2bf983121 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java @@ -410,7 +410,7 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl platforms = thirdPlatformService.listPlatformsByActionKey(ThirdPlatformActions.PUSH_COMPONENT_ACCESS_TOKEN); platforms.stream().forEach(p -> { diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java index 9a8837f120..c3afaa5341 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java @@ -34,12 +34,13 @@ public class BlockChainUploadServiceImpl implements BlockChainUploadService { * @param processEntity 处理进展entity * @param assignedStaffEntities 指派给的工作人员entity */ + @Override public void send2BlockChain(ProjectEntity projectEntity, ProjectProcessEntity processEntity, List assignedStaffEntities, String projectStaffId) { if (true) { return; } - + // 1.项目主信息 BlockChainProjectFormDTO project = null; @@ -131,7 +132,7 @@ public class BlockChainUploadServiceImpl implements BlockChainUploadService { handledStaff.setOrgIdPath(handledStaffEntity.getOrgIdPath()); handledStaff.setProjectId(handledStaffEntity.getProjectId()); } - + if (project == null) { // 处理 BlockChainProcessProjectFormDTO processForm = new BlockChainProcessProjectFormDTO(); diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java index ab54bfd340..a64b74ee99 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java @@ -233,6 +233,7 @@ public class ResiEventServiceImpl extends BaseServiceImpl wordList, List imageList) { if (imageList.size() != NumConstant.ZERO) { wordList.forEach(word -> { @@ -286,4 +287,4 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl getList(String dict) { List list = new ArrayList<>(); Map dictMap = new HashMap<>(); 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 edc1149e6f..715c280a55 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 @@ -17,7 +17,6 @@ import com.epmet.feign.EpmetHeartOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.VolunteerService; -import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -54,6 +53,7 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve * @param customerId * @return */ + @Override public VolunteerDistributionResultDTO getVolunteerDistributionAndLegends(String customerId) { // 1.查询分布 From b86dffd87ab95f5dc5852fdf4504eb448ae987c2 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 27 Dec 2021 18:10:32 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9A=82=E6=97=B6=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E5=86=85=E5=AD=98=E6=BA=A2=E5=87=BA=E9=97=AE=E9=A2=98=20?= =?UTF-8?q?=E5=90=8E=E7=BB=AD=E9=87=8D=E5=86=99=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IssueVoteStatisticalServiceImpl.java | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java index 5ee3f6c8d8..449f52eb50 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java @@ -53,6 +53,7 @@ import com.epmet.service.IssueVoteDetailService; import com.epmet.service.IssueVoteStatisticalService; import com.epmet.utils.ModuleConstants; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -325,16 +326,19 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl collect = notExistedIds.stream().map(issueId -> { - IssueVoteStatisticalDTO dto = new IssueVoteStatisticalDTO(); - dto.setIssueId(issueId); - dto.setSupportCount(NumConstant.ZERO); - dto.setOppositionCount(NumConstant.ZERO); - dto.setVotableCount(Optional.ofNullable(votableCountMap.get(issueGridMap.get(issueId))).orElse(NumConstant.ZERO)); - dto.setCreatedBy(ModuleConstants.CREATED_BY_SYSTEM);dto.setUpdatedBy(ModuleConstants.CREATED_BY_SYSTEM); - return dto; - }).collect(Collectors.toList()); - if(!CollectionUtils.isEmpty(collect)) toInsert.addAll(collect);} + List collect = notExistedIds.stream().map(issueId -> { + IssueVoteStatisticalDTO dto = new IssueVoteStatisticalDTO(); + dto.setIssueId(issueId); + dto.setSupportCount(NumConstant.ZERO); + dto.setOppositionCount(NumConstant.ZERO); + dto.setVotableCount(Optional.ofNullable(votableCountMap.get(issueGridMap.get(issueId))).orElse(NumConstant.ZERO)); + dto.setCreatedBy(ModuleConstants.CREATED_BY_SYSTEM);dto.setUpdatedBy(ModuleConstants.CREATED_BY_SYSTEM); + return dto; + }).collect(Collectors.toList()); + if(!CollectionUtils.isEmpty(collect)) { + toInsert.addAll(collect); + } + } /* List summaryList = issueVoteDetailDao.getVotingSummaryList(notExistedIds); @@ -427,8 +431,11 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl listToUpdate = new ArrayList<>(); setVotableCountsAndUpdateCache(listToUpdate,issues,votableCountMap); - // listToUpdate批量更新 - baseDao.updateBatchByIssueId(listToUpdate); + // listToUpdate批量更新 todo 暂时解决下 分批插入 + if (CollectionUtils.isNotEmpty(listToUpdate)) { + ListUtils.partition(listToUpdate, NumConstant.ONE_HUNDRED) + .forEach(part -> baseDao.updateBatchByIssueId(part)); + } } }else{ @@ -550,8 +557,12 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl