| 
					
				 | 
			
			
				@@ -10,6 +10,8 @@ import cn.com.ctop.common.module.message.handle.impl.EmailSendMsgHandle; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import cn.com.ctop.common.module.service.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import cn.com.ctop.common.module.utils.CtopAdConstant; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportDailyMaterialService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -25,6 +27,7 @@ import org.springframework.boot.test.context.SpringBootTest; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.test.context.ActiveProfiles; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.test.context.junit4.SpringRunner; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.text.SimpleDateFormat; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.Date; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.HashMap; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.List; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -54,6 +57,32 @@ public class SampleTest { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private IRefreshTokenService refreshTokenService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private IKuaishouInterfaceService kuaishouInterfaceService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private IKuaiShouReportDailyMaterialService kuaiShouReportDailyMaterialService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Test 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public void getData() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //1:查询当日数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Date endDate = new Date(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (int i = 0; i < 7; i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Date getStartDate = DateUtils.addDay(endDate, -i); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (CtopOauthToken token : tokens) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                   kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getStartDate, getStartDate); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String format = simpleDateFormat.format(getStartDate); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                kuaiShouReportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(token.getAccountId(), token.getAccessToken(), format, format, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Test 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public void loadBytedanceCreativeData() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         refreshTokenService.getKuaiShouRefresh(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -70,6 +99,10 @@ public class SampleTest { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private IKuaishouWebInterfaceService kuaishouWebInterfaceService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Test 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public void loadKuaishouCookie() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<BindAccountLogin> list = bindAccountLoginService.getListByParams(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_PY, 1); 
			 |