| 
						
						
							
								
							
						
						
					 | 
					@ -14,6 +14,7 @@ import org.springframework.beans.BeanUtils; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import org.springframework.beans.factory.annotation.Autowired; | 
					 | 
					 | 
					import org.springframework.beans.factory.annotation.Autowired; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import org.springframework.stereotype.Service; | 
					 | 
					 | 
					import org.springframework.stereotype.Service; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import java.time.LocalDate; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.util.*; | 
					 | 
					 | 
					import java.util.*; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.util.stream.Collectors; | 
					 | 
					 | 
					import java.util.stream.Collectors; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -39,6 +40,7 @@ public class TopicServiceImpl implements TopicService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        TopicSummaryResultDTO result = new TopicSummaryResultDTO(); | 
					 | 
					 | 
					        TopicSummaryResultDTO result = new TopicSummaryResultDTO(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        String agencyId = this.getLoginUserDetails(tokenDto); | 
					 | 
					 | 
					        String agencyId = this.getLoginUserDetails(tokenDto); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<TopicStatusResultDTO> topicStatus = topicDao.getTopicStatus(agencyId); | 
					 | 
					 | 
					        List<TopicStatusResultDTO> topicStatus = topicDao.getTopicStatus(agencyId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        result.setDeadline(LocalDate.now().minusDays(NumConstant.ONE).toString()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (topicStatus.size() != NumConstant.ZERO){ | 
					 | 
					 | 
					        if (topicStatus.size() != NumConstant.ZERO){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            topicStatus.forEach(topic -> { | 
					 | 
					 | 
					            topicStatus.forEach(topic -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (topic.getTopicStatus().equals(TopicConstant.DISCUSSING)){ | 
					 | 
					 | 
					                if (topic.getTopicStatus().equals(TopicConstant.DISCUSSING)){ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -50,11 +52,11 @@ public class TopicServiceImpl implements TopicService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            }); | 
					 | 
					 | 
					            }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            result.setTopicTotalCount(topicStatus.stream().collect(Collectors.summingInt(TopicStatusResultDTO::getTopicCount))); | 
					 | 
					 | 
					            result.setTopicTotalCount(topicStatus.stream().collect(Collectors.summingInt(TopicStatusResultDTO::getTopicCount))); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        } | 
					 | 
					 | 
					            TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId); | 
					 | 
					 | 
					            if (shiftedCount != null){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (shiftedCount != null){ | 
					 | 
					 | 
					                result.setShiftedTotalCount(shiftedCount.getShiftedIssueCount()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            result.setShiftedTotalCount(shiftedCount.getShiftedIssueCount()); | 
					 | 
					 | 
					                result.setDeadline(shiftedCount.getDeadline()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            result.setDeadline(shiftedCount.getDeadline()); | 
					 | 
					 | 
					            } | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return result; | 
					 | 
					 | 
					        return result; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -178,14 +180,16 @@ public class TopicServiceImpl implements TopicService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        String agencyId = this.getLoginUserDetails(tokenDto); | 
					 | 
					 | 
					        String agencyId = this.getLoginUserDetails(tokenDto); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<TopicSummaryInfoResultDTO> topicSummaryInfo = topicDao.topicSummaryInfo(agencyId); | 
					 | 
					 | 
					        List<TopicSummaryInfoResultDTO> topicSummaryInfo = topicDao.topicSummaryInfo(agencyId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId); | 
					 | 
					 | 
					        TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        Integer collect = topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue)); | 
					 | 
					 | 
					        if (topicSummaryInfo.size() != NumConstant.ZERO && shiftedCount != null) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        String ratio; | 
					 | 
					 | 
					            Integer collect = topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue)); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        ratio = collect == NumConstant.ZERO ? NumConstant.ZERO + TopicConstant.RATIO : ((float)shiftedCount.getShiftedIssueCount() / (float)collect) * NumConstant.ONE_HUNDRED + TopicConstant.RATIO; | 
					 | 
					 | 
					            String ratio; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        TopicSummaryInfoResultDTO result = new TopicSummaryInfoResultDTO(); | 
					 | 
					 | 
					            ratio = collect == NumConstant.ZERO ? NumConstant.ZERO + TopicConstant.RATIO : ((float) shiftedCount.getShiftedIssueCount() / (float) collect) * NumConstant.ONE_HUNDRED + TopicConstant.RATIO; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        result.setName(TopicConstant.SHIFTED); | 
					 | 
					 | 
					            TopicSummaryInfoResultDTO result = new TopicSummaryInfoResultDTO(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        result.setRatio(ratio); | 
					 | 
					 | 
					            result.setName(TopicConstant.SHIFTED); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        result.setValue(shiftedCount.getShiftedIssueCount()); | 
					 | 
					 | 
					            result.setRatio(ratio); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        topicSummaryInfo.add(result); | 
					 | 
					 | 
					            result.setValue(shiftedCount.getShiftedIssueCount()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            topicSummaryInfo.add(result); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return topicSummaryInfo; | 
					 | 
					 | 
					        return topicSummaryInfo; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |