| 
					
				 | 
			
			
				@@ -6,6 +6,7 @@ import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.tzld.piaoquan.longarticle.common.enums.ContentStatusEnum; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.tzld.piaoquan.longarticle.common.enums.PublicFlagEnum; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.tzld.piaoquan.longarticle.common.enums.PublishGzhPushTypeEnum; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.tzld.piaoquan.longarticle.common.enums.TransformationEnum; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.tzld.piaoquan.longarticle.model.bo.VideoDetail; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.tzld.piaoquan.longarticle.model.dto.ArticleSortRequest; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -260,20 +261,23 @@ public class ContentServiceImpl implements ContentService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         SingleVideoSource singleVideoSource = singleVideoSources.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String ossPath = singleVideoSource.getVideoOssPath(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String title = singleVideoSource.getMiniProgramTitle(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        int transformationType = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //是否存在片尾引导 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        int transformationType; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         int publishType = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String videoOriginType = "video_pool"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Long videoOriginId = (long) singleVideoSource.getId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         VideoEndScreen videoEndScreen = existVideoEndScreen(videoOriginId, videoOriginType); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //查询到改写的视频  随机选择原视频或者改写后的视频 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (videoEndScreen != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            transformationType = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            int random = ToolUtil.getRandom(2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (random == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            transformationType = TransformationEnum.EXIST.getType(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //存在片尾引导后  50%概率走有片尾引导的视频 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            publishType = ToolUtil.getRandom(2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (publishType == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 ossPath = videoEndScreen.getNewOssPath(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 title = videoEndScreen.getTitle(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                publishType = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            transformationType = TransformationEnum.NOT_EXIST.getType(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         VideoDetail videoDetail = videoService.publish(ossPath, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 SINGLE_VIDEO_UID, title); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -306,20 +310,21 @@ public class ContentServiceImpl implements ContentService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             String title = kimiText.getKimiTitle(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            int transformationType = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            int transformationType; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             int publishType = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             String videoOriginType = "long_article"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Long videoOriginId = (long) crawlerVideoId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             VideoEndScreen videoEndScreen = existVideoEndScreen(videoOriginId, videoOriginType); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //查询到改写的视频  随机选择原视频或者改写后的视频 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (videoEndScreen != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                transformationType = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                int random = ToolUtil.getRandom(2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (random == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                transformationType = TransformationEnum.EXIST.getType(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                publishType = ToolUtil.getRandom(2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (publishType == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     videoOssPath = videoEndScreen.getNewOssPath(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     title = videoEndScreen.getTitle(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    publishType = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                transformationType = TransformationEnum.NOT_EXIST.getType(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             VideoDetail videoDetail = videoService.publish(videoOssPath, userId, title); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (videoDetail == null) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -389,7 +394,7 @@ public class ContentServiceImpl implements ContentService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public void logEvent(String videoOriginType, Long videoOriginId, String videoId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    int transformationType, int publishType) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         int transformationType, int publishType) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         JSONObject jsonObject = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         jsonObject.put("code", "changwen_video_publish"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         JSONObject data = new JSONObject(); 
			 |