| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -283,7 +283,7 @@ public class PartyGuideServiceImpl implements PartyGuideService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (isGrid == false){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                orgIds.addAll(directGridIds.stream().map(m -> m.getGridId()).collect(Collectors.toList())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<JoinUserCountResultDTO> joinUserCountByAgencyList = actUserRelationService.selectJoinUserCount(customerId, monthId, ScreenConstant.AGENCY); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId, null); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataByAgencyList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.AGENCY, orgIds); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<ScreenPartyBranchDataFormDTO> screenPartyBranchData = agencyService.selectAllAgencyIdToOrganize(customerId, monthId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataListAgencyAll = gridService.selectAllGridIdToOrganize(customerId, monthId); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -297,7 +297,6 @@ public class PartyGuideServiceImpl implements PartyGuideService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (isGrid == true){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId, ScreenConstant.GRID); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                agencyIdList.forEach(agency -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, orgIds); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    finalResult.forEach(fl -> { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -329,7 +328,7 @@ public class PartyGuideServiceImpl implements PartyGuideService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                            fl.setOrganizeCount(calAdd(organize.getOrganizeCount(),actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)))); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                    }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                    joinUserCountByAgencyList.forEach(join -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                    joinUserCountList.forEach(join -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                        if (join.getOrgId().equals(agencyId)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                            fl.setJoinUserCount(calAdd(join.getJoinUserCount(),actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)))); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                        } | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -340,7 +339,6 @@ public class PartyGuideServiceImpl implements PartyGuideService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                log.error("结果"+JSON.toJSONString(finalResult)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                delOrganize(customerId,monthId,orgIds); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                insertOrganize(finalResult); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }else { | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -355,7 +353,6 @@ public class PartyGuideServiceImpl implements PartyGuideService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    // 存在直属网格
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (!CollectionUtils.isEmpty(disGridIds)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        orgIds.addAll(disGridIds); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId, ScreenConstant.GRID); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, disGridIds); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        finalResult.forEach(r -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            screenPartyBranchDataList.forEach(party ->{ | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -384,13 +381,12 @@ public class PartyGuideServiceImpl implements PartyGuideService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                    form.setOrganizeCount(calAdd(organize.getOrganizeCount(),screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)))); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            joinUserCountByAgencyList.forEach(join -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            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())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |