diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java index deddc49f27..b58a38ee7e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java @@ -81,7 +81,7 @@ public class PartyGuideServiceImpl implements PartyGuideService { if (!CollectionUtils.isEmpty(customerIds)){ String finalMonthId = monthId; customerIds.forEach(oneCustomerId -> { -// partyGuideExtractParty(oneCustomerId, finalMonthId); + partyGuideExtractParty(oneCustomerId, finalMonthId); partyGuideExtractOrganize(oneCustomerId,finalMonthId); }); } @@ -296,9 +296,10 @@ public class PartyGuideServiceImpl implements PartyGuideService { } }); }); + List screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, null, orgIds); if (isGrid == true){ agencyIdList.forEach(agency -> { - List screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, orgIds); + finalResult.forEach(fl -> { screenPartyBranchDataList.forEach(sp -> { if (fl.getOrgId().equals(sp.getOrgId())){ @@ -353,7 +354,6 @@ public class PartyGuideServiceImpl implements PartyGuideService { // 存在直属网格 if (!CollectionUtils.isEmpty(disGridIds)){ orgIds.addAll(disGridIds); - List screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, disGridIds); finalResult.forEach(r -> { screenPartyBranchDataList.forEach(party ->{ if (r.getOrgId().equals(party.getOrgId())){ @@ -370,23 +370,25 @@ public class PartyGuideServiceImpl implements PartyGuideService { } delOrganize(customerId,monthId,orgIds); List disPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByOrgId(customerId, monthId, disGridIds); - List screenPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByParentId(customerId, monthId, agencyId); - screenPartyBranchDataList.addAll(disPartyBranchDataList); - if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){ + List screenPartyBranchDataByParentList = partyBranchDataService.selectScreenPartyBranchDataByParentId(customerId, monthId, agencyId); + screenPartyBranchDataByParentList.addAll(disPartyBranchDataList); + if (!CollectionUtils.isEmpty(screenPartyBranchDataByParentList)){ finalResult.forEach(form -> { - form.setJoinUserCount(screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))); - form.setOrganizeCount(screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))); - screenPartyBranchDataByAgencyList.forEach(organize -> { - if (organize.getOrgId().equals(agencyId)){ - form.setOrganizeCount(calAdd(organize.getOrganizeCount(),screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)))); - } - }); - joinUserCountList.forEach(join -> { - if (join.getOrgId().equals(agencyId)){ - form.setJoinUserCount(calAdd(join.getJoinUserCount(),screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)))); - } - }); - form.setAverageJoinUserCount(form.getOrganizeCount()==NumConstant.ZERO?NumConstant.ZERO : (form.getJoinUserCount() / form.getOrganizeCount())); + if (form.getOrgId().equals(agencyId)) { + form.setJoinUserCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))); + form.setOrganizeCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))); + screenPartyBranchDataByParentList.forEach(organize -> { + if (organize.getOrgId().equals(agencyId)) { + form.setOrganizeCount(calAdd(organize.getOrganizeCount(), screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)))); + } + }); + joinUserCountList.forEach(join -> { + if (join.getOrgId().equals(agencyId)) { + form.setJoinUserCount(calAdd(join.getJoinUserCount(), screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)))); + } + }); + form.setAverageJoinUserCount(form.getOrganizeCount() == NumConstant.ZERO ? NumConstant.ZERO : (form.getJoinUserCount() / form.getOrganizeCount())); + } }); } }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml index 3b5bc0edcf..055d888c7c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml @@ -51,7 +51,9 @@ AND ACT_STATUS = 'finished' AND CUSTOMER_ID = #{customerId} AND DATE_FORMAT( ACTUAL_END_TIME, '%Y%m' ) = #{monthId} - AND SPONSOR_TYPE = #{orgType} + + AND SPONSOR_TYPE = #{orgType} + AND (