|
|
@ -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<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, null, orgIds); |
|
|
|
if (isGrid == true){ |
|
|
|
agencyIdList.forEach(agency -> { |
|
|
|
List<ScreenPartyBranchDataFormDTO> 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<ScreenPartyBranchDataFormDTO> 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<ScreenPartyBranchDataFormDTO> disPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByOrgId(customerId, monthId, disGridIds); |
|
|
|
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByParentId(customerId, monthId, agencyId); |
|
|
|
screenPartyBranchDataList.addAll(disPartyBranchDataList); |
|
|
|
if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){ |
|
|
|
List<ScreenPartyBranchDataFormDTO> 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())); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|