|  |  | @ -1,6 +1,7 @@ | 
			
		
	
		
			
				
					|  |  |  | package com.epmet.service.evaluationindex.extract.dataToIndex.impl; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.constant.NumConstant; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.ConvertUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.DateUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.constant.ExtractConstant; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.constant.ProjectEvaluateConstant; | 
			
		
	
	
		
			
				
					|  |  | @ -8,7 +9,9 @@ import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.extract.form.GridIssueCountResultDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.extract.result.*; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.indexcollect.result.PartyJoinThreeMeetDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.evaluationindex.extract.dataToIndex.CalGridIndexService; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.evaluationindex.extract.todata.*; | 
			
		
	
	
		
			
				
					|  |  | @ -19,6 +22,7 @@ import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.group.GroupDataService; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.heart.ActInfoService; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.partymember.PartyMemberService; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.stats.DimCustomerPartymemberService; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.stats.FactArticlePublishedGridDailyService; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.stats.user.FactRegUserGridMonthlyService; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.user.UserService; | 
			
		
	
	
		
			
				
					|  |  | @ -78,6 +82,8 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { | 
			
		
	
		
			
				
					|  |  |  |     private ScreenCustomerGridService gridService; | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private GroupDataService groupDataService; | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private DimCustomerPartymemberService dimCustomerPartymemberService; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * @Description  计算网格指标党建能力 | 
			
		
	
	
		
			
				
					|  |  | @ -140,7 +146,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { | 
			
		
	
		
			
				
					|  |  |  |         // 组织“三会一课”次数 前网格下  满足【未取消的活动 and  签到记录>1 and 活动开始时间在当前时间维度内】 +1
 | 
			
		
	
		
			
				
					|  |  |  |         Map<String,Integer> createThreeMeetsCountMap=getCreateThreeMeetsCountMap(customerId,monthId); | 
			
		
	
		
			
				
					|  |  |  |         // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数
 | 
			
		
	
		
			
				
					|  |  |  |         Map<String,Integer> joinThreeMeetsCountMap=getJoinThreeMeetsCountMap(customerId,monthId); | 
			
		
	
		
			
				
					|  |  |  |         List<PartyJoinThreeMeetDTO> joinThreeMeetsCountList=getJoinThreeMeetsCountMap(customerId,monthId); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         String quarterId = DateUtils.getQuarterId(monthId); | 
			
		
	
		
			
				
					|  |  |  |         String yearId = DateUtils.getYearId(monthId); | 
			
		
	
	
		
			
				
					|  |  | @ -234,8 +240,14 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { | 
			
		
	
		
			
				
					|  |  |  |                 r.setCreateThreeMeetsCount(createThreeMeetsCountMap.get(r.getGridId())); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数
 | 
			
		
	
		
			
				
					|  |  |  |             if (joinThreeMeetsCountMap.containsKey(r.getGridId())) { | 
			
		
	
		
			
				
					|  |  |  |                 r.setJoinThreeMeetsCount(joinThreeMeetsCountMap.get(r.getGridId())); | 
			
		
	
		
			
				
					|  |  |  |             if (!CollectionUtils.isEmpty(joinThreeMeetsCountList)) { | 
			
		
	
		
			
				
					|  |  |  |                 Integer joinThreeMeetsCount = NumConstant.ZERO; | 
			
		
	
		
			
				
					|  |  |  |                 for (PartyJoinThreeMeetDTO dto : joinThreeMeetsCountList) { | 
			
		
	
		
			
				
					|  |  |  |                     if (dto.getGridId().equals(r.getGridId())) { | 
			
		
	
		
			
				
					|  |  |  |                         joinThreeMeetsCount += dto.getJoinThreeMeetsCount(); | 
			
		
	
		
			
				
					|  |  |  |                     } | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |                 r.setJoinThreeMeetsCount(joinThreeMeetsCount); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         }); | 
			
		
	
		
			
				
					|  |  |  |         delPartyAbility(customerId, monthId); | 
			
		
	
	
		
			
				
					|  |  | @ -257,12 +269,27 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { | 
			
		
	
		
			
				
					|  |  |  |         return resultMap; | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     private Map<String, Integer> getJoinThreeMeetsCountMap(String customerId, String monthId) { | 
			
		
	
		
			
				
					|  |  |  |     private List<PartyJoinThreeMeetDTO> getJoinThreeMeetsCountMap(String customerId, String monthId) { | 
			
		
	
		
			
				
					|  |  |  |         List<PartyJoinThreeMeetDTO> partyJoinThreeMeetDTOList = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |         // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数
 | 
			
		
	
		
			
				
					|  |  |  |         //    todo
 | 
			
		
	
		
			
				
					|  |  |  |         return null; | 
			
		
	
		
			
				
					|  |  |  |         //1、查询出当前客户下注册的党员
 | 
			
		
	
		
			
				
					|  |  |  |         List<PartyMemberInfoResultDTO> list = dimCustomerPartymemberService.selectPartyMemberInfoByCustomerId(customerId); | 
			
		
	
		
			
				
					|  |  |  |         if (!CollectionUtils.isEmpty(list)) { | 
			
		
	
		
			
				
					|  |  |  |             partyJoinThreeMeetDTOList = ConvertUtils.sourceToTarget(list, PartyJoinThreeMeetDTO.class); | 
			
		
	
		
			
				
					|  |  |  |             //2、查询出所有用户本月签到次数
 | 
			
		
	
		
			
				
					|  |  |  |             List<CpcIndexCommonDTO> userList = groupDataService.selectJoinThreeMeetsCount(customerId, monthId); | 
			
		
	
		
			
				
					|  |  |  |             for (PartyJoinThreeMeetDTO partyJoinThreeMeetDTO : partyJoinThreeMeetDTOList) { | 
			
		
	
		
			
				
					|  |  |  |                 partyJoinThreeMeetDTO.setJoinThreeMeetsCount(NumConstant.ZERO); | 
			
		
	
		
			
				
					|  |  |  |                 for (CpcIndexCommonDTO cpcIndexCommonDTO : userList) { | 
			
		
	
		
			
				
					|  |  |  |                     if (partyJoinThreeMeetDTO.getUserId().equals(cpcIndexCommonDTO.getUserId())) { | 
			
		
	
		
			
				
					|  |  |  |                         partyJoinThreeMeetDTO.setJoinThreeMeetsCount(cpcIndexCommonDTO.getIndexValue()); | 
			
		
	
		
			
				
					|  |  |  |                         break; | 
			
		
	
		
			
				
					|  |  |  |                     } | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         return partyJoinThreeMeetDTOList; | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * @Description  计算网格指标治理能力 | 
			
		
	
	
		
			
				
					|  |  | 
 |