| 
					
				 | 
			
			
				@@ -1,13 +1,13 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 package com.yonge.cooleshow.biz.dal.service.impl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.yonge.cooleshow.biz.dal.dao.ExposureReportDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.yonge.cooleshow.biz.dal.entity.ExposureReport; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.yonge.cooleshow.biz.dal.dao.ExposureRecordDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.yonge.cooleshow.biz.dal.entity.ExposureRecord; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.yonge.cooleshow.biz.dal.service.CourseGroupService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.yonge.cooleshow.biz.dal.service.ExposureReportService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.yonge.cooleshow.biz.dal.service.ExposureRecordService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.yonge.cooleshow.biz.dal.service.MusicSheetService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.yonge.cooleshow.biz.dal.service.VideoLessonGroupService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.yonge.cooleshow.biz.dal.wrapper.ExposureReportWrapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.yonge.cooleshow.biz.dal.wrapper.ExposureRecordWrapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.yonge.toolset.utils.date.DateUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.slf4j.Logger; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.slf4j.LoggerFactory; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -21,8 +21,8 @@ import java.util.Map; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.stream.Collectors; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 @Service 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-public class ExposureReportServiceImpl extends ServiceImpl<ExposureReportDao, ExposureReport> implements ExposureReportService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private final static Logger log = LoggerFactory.getLogger(ExposureReportServiceImpl.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+public class ExposureRecordServiceImpl extends ServiceImpl<ExposureRecordDao, ExposureRecord> implements ExposureRecordService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private final static Logger log = LoggerFactory.getLogger(ExposureRecordServiceImpl.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private CourseGroupService courseGroupService; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -31,23 +31,23 @@ public class ExposureReportServiceImpl extends ServiceImpl<ExposureReportDao, Ex 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private VideoLessonGroupService videoLessonGroupService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public ExposureReportDao getDao() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public ExposureRecordDao getDao() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return baseMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Transactional(rollbackFor = Exception.class) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public void report(List<ExposureReportWrapper.SaveExposureReportDto> exposureReportDto) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public void record(List<ExposureRecordWrapper.SaveExposureRecordDto> exposureRecordDto) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Date now = new Date(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String exposureTime = DateUtil.format(now, DateUtil.DEFAULT_PATTERN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        exposureReportDto.forEach(e->e.setExposureTime(exposureTime)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        baseMapper.saveExposureReport(exposureReportDto); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        exposureRecordDto.forEach(e->e.setExposureTime(exposureTime)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        baseMapper.saveExposureRecord(exposureRecordDto); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //按类型分组 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        Map<String, List<ExposureReportWrapper.SaveExposureReportDto>> typeMap = exposureReportDto.stream().collect(Collectors.groupingBy(ExposureReportWrapper.SaveExposureReportDto::getObjectType)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Map<String, List<ExposureRecordWrapper.SaveExposureRecordDto>> typeMap = exposureRecordDto.stream().collect(Collectors.groupingBy(ExposureRecordWrapper.SaveExposureRecordDto::getObjectType)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         typeMap.forEach((k,v)->{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            List<ExposureReportWrapper.SaveExposureReportDto> saveExposureReportDtos = typeMap.get(k); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            List<ExposureRecordWrapper.SaveExposureRecordDto> saveExposureReportDtos = typeMap.get(k); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //按对象id分组,并获取集合数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Map<Long, Integer> exposureNumMap = saveExposureReportDtos.stream().collect(Collectors.groupingBy(ExposureReportWrapper.SaveExposureReportDto::getObjectId, Collectors.summingInt(e -> 1))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Map<Long, Integer> exposureNumMap = saveExposureReportDtos.stream().collect(Collectors.groupingBy(ExposureRecordWrapper.SaveExposureRecordDto::getObjectId, Collectors.summingInt(e -> 1))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             exposureNumMap.forEach((objectId,exposureNum)-> { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if ("LIVE".equals(k)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     courseGroupService.getDao().updateExposureNum(objectId, exposureNum); 
			 |