|  |  | @ -6,6 +6,8 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.exception.RenException; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.Result; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.CustomerDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.IssueDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.feign.GovIssueOpenFeignClient; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.feign.OperCrmOpenFeignClient; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.modules.enums.AchievementTypeEnum; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.modules.group.dao.ResiGroupDao; | 
			
		
	
	
		
			
				
					|  |  | @ -29,6 +31,7 @@ import org.springframework.util.CollectionUtils; | 
			
		
	
		
			
				
					|  |  |  | import java.util.ArrayList; | 
			
		
	
		
			
				
					|  |  |  | import java.util.Date; | 
			
		
	
		
			
				
					|  |  |  | import java.util.List; | 
			
		
	
		
			
				
					|  |  |  | import java.util.Map; | 
			
		
	
		
			
				
					|  |  |  | import java.util.stream.Collectors; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | /** | 
			
		
	
	
		
			
				
					|  |  | @ -49,6 +52,8 @@ public class StatsAchievementServiceImpl extends AbstractStatsAchievementService | 
			
		
	
		
			
				
					|  |  |  |     private ResiGroupDao resiGroupDao; | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private OperCrmOpenFeignClient operCrmOpenFeignClient; | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private GovIssueOpenFeignClient govIssueOpenFeignClient; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
	
		
			
				
					|  |  | @ -73,6 +78,13 @@ public class StatsAchievementServiceImpl extends AbstractStatsAchievementService | 
			
		
	
		
			
				
					|  |  |  |                 log.warn("没有需要初始化的小组数据,customerId:{}", customerId); | 
			
		
	
		
			
				
					|  |  |  |                 continue; | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             //3 获取客户下议题数据
 | 
			
		
	
		
			
				
					|  |  |  |             Result<List<IssueDTO>> issueListResult = govIssueOpenFeignClient.getIssueList(customerId); | 
			
		
	
		
			
				
					|  |  |  |             if (issueListResult == null || CollectionUtils.isEmpty(issueListResult.getData())) { | 
			
		
	
		
			
				
					|  |  |  |                 log.warn("没有需要初始化的小组转为议题的数据,customerId:{}", customerId); | 
			
		
	
		
			
				
					|  |  |  |                 continue; | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             Map<String, Date> issueCreateTimeMap = issueListResult.getData().stream().collect(Collectors.toMap(IssueDTO::getId, IssueDTO::getCreatedTime)); | 
			
		
	
		
			
				
					|  |  |  |             for (ResiGroupEntity groupEntity : groupEntities) { | 
			
		
	
		
			
				
					|  |  |  |                 //2.1 获取小组成员数据
 | 
			
		
	
		
			
				
					|  |  |  |                 String groupId = groupEntity.getId(); | 
			
		
	
	
		
			
				
					|  |  | @ -114,7 +126,7 @@ public class StatsAchievementServiceImpl extends AbstractStatsAchievementService | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                 //设置实际达到成就时间 最后一条为未实现 所以-1
 | 
			
		
	
		
			
				
					|  |  |  |                 for (int j = 0; j < toIssueArriveList.size() - 1; j++) { | 
			
		
	
		
			
				
					|  |  |  |                     toIssueArriveList.get(j).setArriveTime(toIssueTopicList.get(j).getCreatedTime()); | 
			
		
	
		
			
				
					|  |  |  |                     toIssueArriveList.get(j).setArriveTime(issueCreateTimeMap.getOrDefault(toIssueTopicList.get(j).getIssueId(),new Date())); | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                 //2.6 计算出 话题被解决 达到的成就
 | 
			
		
	
	
		
			
				
					|  |  | @ -127,9 +139,11 @@ public class StatsAchievementServiceImpl extends AbstractStatsAchievementService | 
			
		
	
		
			
				
					|  |  |  |                 for (int j = 0; j < resolveTopicArriveList.size() - 1; j++) { | 
			
		
	
		
			
				
					|  |  |  |                     resolveTopicArriveList.get(j).setArriveTime(resolveTopicList.get(j).getCreatedTime()); | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |                 saveOrUpdate(topicArriveList, true); | 
			
		
	
		
			
				
					|  |  |  |                 saveOrUpdate(toIssueArriveList, true); | 
			
		
	
		
			
				
					|  |  |  |                 saveOrUpdate(resolveTopicArriveList, true); | 
			
		
	
		
			
				
					|  |  |  |                 List<ResiGroupAchievementStatsEntity> list = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |                 list.addAll(topicArriveList); | 
			
		
	
		
			
				
					|  |  |  |                 list.addAll(toIssueArriveList); | 
			
		
	
		
			
				
					|  |  |  |                 list.addAll(resolveTopicArriveList); | 
			
		
	
		
			
				
					|  |  |  |                 saveOrUpdate(list, true); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | 
 |