Преглед изворни кода

添加出价,深度出价字段

syh пре 4 година
родитељ
комит
31958bd1ec

+ 1 - 33
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -6,11 +6,9 @@ import cn.com.ctop.common.module.entity.UserAllocation;
 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.IKuaiShouDailyReportTaskService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
 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.mapper.KuaishouAgentAccountMapper;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceFundDailyService;
@@ -37,8 +35,6 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
-import static org.jeecg.common.util.DateUtils.getAnotherDay;
-
 @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
 @ActiveProfiles("wps")
@@ -201,22 +197,6 @@ public class SampleTest {
         }
     }
 
-    @Autowired
-    private IKuaiShouDailyReportTaskService dailyReportTaskService;
-    /**
-     * 测试获取快手图片消耗数据入库
-     */
-    @Test
-    public void loadKuaishouImageTaskFile(){
-        String nowDate = DateUtils.getDate("yyyy-MM-dd");
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        for(int i=1;i<15;i++){
-            String statDate = getAnotherDay("yyyy-MM-dd", nowDate, -i);
-            tokens.forEach(token -> dailyReportTaskService.getTaskList(token.getAccountId(), token.getAccessToken(), statDate));
-        }
-        //  查询快手token
-    }
-
     @Test
     public void testLoadBytedanceImageData(){
         List<CtopOauthToken>tokens = tokenService.selectToutiaoToken();
@@ -238,8 +218,7 @@ public class SampleTest {
         System.out.println("素材数据获取完成");
 
     }
-    @Autowired
-    private KuaishouAgentAccountMapper kuaishouAgentAccountMapper;
+
     @Autowired
     private IKuaishouReportDailyAgentService kuaishouReportDailyAgentService;
     @Test
@@ -279,17 +258,6 @@ public class SampleTest {
     @Autowired
     IUReportService uReportService;
 
-    @Test
-    public void loadBytedanceData(){
-        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        for (int i=0;i<tokens.size();i++) {
-            for(int j=0;j<4;j++){
-                String getDate = DateUtils.formatDate(DateUtils.addDay(new Date(), -j));
-                bytedanceReportService.bytedanceVideoMaterialReport(tokens.get(i), getDate, getDate);
-            }
-        }
-    }
-
     @Autowired
     private IBytedanceReportService bytedanceReportService;
     @Test

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/RuleDataPlan.java

@@ -41,6 +41,8 @@ public class RuleDataPlan {
 	private String pricing;
 	private BigDecimal budget;
 	private Integer status;
+	private BigDecimal cpaBid;
+	private BigDecimal deepCpabid;
 	private Date createTime;
 	private Date updateTime;
 

+ 13 - 11
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ReportServiceImpl.java

@@ -185,20 +185,22 @@ public class ReportServiceImpl implements IReportService {
         UserAllocation allocation = userAllocationService.getByAccountId(token.getAccountId());
         for (var i = 0; i < dataArray.size(); i++) {
             var data = dataArray.getJSONObject(i);
-            var dailyReport = new RuleDataPlan(data, token.getAccountId());
-            dailyReport.setAccountName(allocation.getAuthName());
-            ByteDanceAdvertisePlan plan = advertiserDataService.getSinglePlanById(token,dailyReport.getId()+"");
+            var ruleDataPlan = new RuleDataPlan(data, token.getAccountId());
+            ruleDataPlan.setAccountName(allocation.getAuthName());
+            ByteDanceAdvertisePlan plan = advertiserDataService.getSinglePlanById(token,ruleDataPlan.getId()+"");
             if(null!=plan){
-                dailyReport.setBudget(plan.getBudget());
-                dailyReport.setDownloadUrl(plan.getDownloadUrl());
-                dailyReport.setExternalUrl(plan.getExternalUrl());
-                dailyReport.setPricing(plan.getPricing());
+                ruleDataPlan.setBudget(plan.getBudget());
+                ruleDataPlan.setDownloadUrl(plan.getDownloadUrl());
+                ruleDataPlan.setExternalUrl(plan.getExternalUrl());
+                ruleDataPlan.setPricing(plan.getPricing());
+                ruleDataPlan.setCpaBid(plan.getCpaBid());
+                ruleDataPlan.setDeepCpabid(plan.getDeepCpaBid());
                 RuleDataTarget target = new RuleDataTarget();
                 JSONObject audienceObject = JSONObject.parseObject(plan.getAudience());
                 target.setAccountId(token.getAccountId());
                 target.setAccountName(allocation.getAuthName());
-                target.setPlanId(dailyReport.getPlanId());
-                target.setId(dailyReport.getPlanId());
+                target.setPlanId(ruleDataPlan.getPlanId());
+                target.setId(ruleDataPlan.getPlanId());
                 target.setCreateTime(new Date());
                 target.setUpdateTime(new Date());
                 if(null!=audienceObject.getString("retargeting_tags_exclude")){
@@ -231,10 +233,10 @@ public class ReportServiceImpl implements IReportService {
                 Map<String, Object> creativeDetail = creativeService.getCreativeDetail(token, plan.getId());
                 if(null!=creativeDetail.get("data")){
                     JSONObject detail = (JSONObject) creativeDetail.get("data");
-                    formatCreativeData(detail,allocation,dailyReport);
+                    formatCreativeData(detail,allocation,ruleDataPlan);
                 }
             }
-            ruleDataPlanService.saveOrUpdate(dailyReport);
+            ruleDataPlanService.saveOrUpdate(ruleDataPlan);
         }
         getPlanRuleDataByPage(token, conditions, page + 1);
     }