| 
						
						
							
								
							
						
						
					 | 
					@ -81,7 +81,7 @@ public class PartyGuideServiceImpl implements PartyGuideService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (!CollectionUtils.isEmpty(customerIds)){ | 
					 | 
					 | 
					        if (!CollectionUtils.isEmpty(customerIds)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            String finalMonthId = monthId; | 
					 | 
					 | 
					            String finalMonthId = monthId; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            customerIds.forEach(oneCustomerId -> { | 
					 | 
					 | 
					            customerIds.forEach(oneCustomerId -> { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					//                partyGuideExtractParty(oneCustomerId, finalMonthId);
 | 
					 | 
					 | 
					                partyGuideExtractParty(oneCustomerId, finalMonthId); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                partyGuideExtractOrganize(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){ | 
					 | 
					 | 
					            if (isGrid == true){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                agencyIdList.forEach(agency -> { | 
					 | 
					 | 
					                agencyIdList.forEach(agency -> { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, orgIds); | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    finalResult.forEach(fl -> { | 
					 | 
					 | 
					                    finalResult.forEach(fl -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        screenPartyBranchDataList.forEach(sp -> { | 
					 | 
					 | 
					                        screenPartyBranchDataList.forEach(sp -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            if (fl.getOrgId().equals(sp.getOrgId())){ | 
					 | 
					 | 
					                            if (fl.getOrgId().equals(sp.getOrgId())){ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -353,7 +354,6 @@ public class PartyGuideServiceImpl implements PartyGuideService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    // 存在直属网格
 | 
					 | 
					 | 
					                    // 存在直属网格
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    if (!CollectionUtils.isEmpty(disGridIds)){ | 
					 | 
					 | 
					                    if (!CollectionUtils.isEmpty(disGridIds)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        orgIds.addAll(disGridIds); | 
					 | 
					 | 
					                        orgIds.addAll(disGridIds); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, disGridIds); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        finalResult.forEach(r -> { | 
					 | 
					 | 
					                        finalResult.forEach(r -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            screenPartyBranchDataList.forEach(party ->{ | 
					 | 
					 | 
					                            screenPartyBranchDataList.forEach(party ->{ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                                if (r.getOrgId().equals(party.getOrgId())){ | 
					 | 
					 | 
					                                if (r.getOrgId().equals(party.getOrgId())){ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -370,23 +370,25 @@ public class PartyGuideServiceImpl implements PartyGuideService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    } | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    delOrganize(customerId,monthId,orgIds); | 
					 | 
					 | 
					                    delOrganize(customerId,monthId,orgIds); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    List<ScreenPartyBranchDataFormDTO> disPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByOrgId(customerId, monthId, disGridIds); | 
					 | 
					 | 
					                    List<ScreenPartyBranchDataFormDTO> disPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByOrgId(customerId, monthId, disGridIds); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByParentId(customerId, monthId, agencyId); | 
					 | 
					 | 
					                    List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataByParentList = partyBranchDataService.selectScreenPartyBranchDataByParentId(customerId, monthId, agencyId); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    screenPartyBranchDataList.addAll(disPartyBranchDataList); | 
					 | 
					 | 
					                    screenPartyBranchDataByParentList.addAll(disPartyBranchDataList); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){ | 
					 | 
					 | 
					                    if (!CollectionUtils.isEmpty(screenPartyBranchDataByParentList)){ | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                        finalResult.forEach(form -> { | 
					 | 
					 | 
					                        finalResult.forEach(form -> { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                            form.setJoinUserCount(screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))); | 
					 | 
					 | 
					                            if (form.getOrgId().equals(agencyId)) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                            form.setOrganizeCount(screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))); | 
					 | 
					 | 
					                                form.setJoinUserCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                            screenPartyBranchDataByAgencyList.forEach(organize -> { | 
					 | 
					 | 
					                                form.setOrganizeCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                                if (organize.getOrgId().equals(agencyId)){ | 
					 | 
					 | 
					                                screenPartyBranchDataByParentList.forEach(organize -> { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                                    form.setOrganizeCount(calAdd(organize.getOrganizeCount(),screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)))); | 
					 | 
					 | 
					                                    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)){ | 
					 | 
					 | 
					                                joinUserCountList.forEach(join -> { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                                    form.setJoinUserCount(calAdd(join.getJoinUserCount(),screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)))); | 
					 | 
					 | 
					                                    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())); | 
					 | 
					 | 
					                                }); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                                form.setAverageJoinUserCount(form.getOrganizeCount() == NumConstant.ZERO ? NumConstant.ZERO : (form.getJoinUserCount() / form.getOrganizeCount())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        }); | 
					 | 
					 | 
					                        }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    } | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                }); | 
					 | 
					 | 
					                }); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |