瀏覽代碼

代码回退

songyh 4 年之前
父節點
當前提交
c1d511d46b

+ 9 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java

@@ -187,7 +187,9 @@ public class CallbackController {
                     userAllocation.setSystemType(systemType);
                     // 获取快手昵称
                     userAllocation.setAuthName((String) advertiseBaseInfoMap.get("userName"));
-                    userAllocation.setAuthBeginTime(authBeginTime);
+                    if(null!=authBeginTime&&!authBeginTime.trim().equals("")){
+                        userAllocation.setAuthBeginTime(authBeginTime);
+                    }
                     userAllocation.setMediaId(mediaId);
                     userAllocation.setAccountId(accountId);
                     userAllocation.setProjectId(projectId);
@@ -343,7 +345,9 @@ public class CallbackController {
                             userAllocation.setProjectId(projectId);
                             userAllocation.setSystemType(systemType);
                             userAllocation.setAuthName((String) advertiserDataMap.get("name"));
-                            userAllocation.setAuthBeginTime(authBeginTime);
+                            if(null!=authBeginTime&&!authBeginTime.trim().equals("")){
+                                userAllocation.setAuthBeginTime(authBeginTime);
+                            }
                             userAllocation.setAdvertiserId(advertiserId);
                             userAllocation.setWarningProportion(warningProportion);
                             userAllocation.setWarningAmount(warningAmount);
@@ -396,7 +400,9 @@ public class CallbackController {
                     userAllocation.setProjectId(projectId);
                     userAllocation.setSystemType(systemType);
                     userAllocation.setAuthName((String) advertiserDataMap.get("name"));
-                    userAllocation.setAuthBeginTime(authBeginTime);
+                    if(null!=authBeginTime&&!authBeginTime.trim().equals("")){
+                        userAllocation.setAuthBeginTime(authBeginTime);
+                    }
                     userAllocation.setAdvertiserId(advertiserId);
                     userAllocation.setWarningProportion(warningProportion);
                     userAllocation.setWarningAmount(warningAmount);

+ 6 - 14
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -780,27 +780,19 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
     @Override
     public void loadKuaishouDataSingle(CtopOauthToken token) throws java.text.ParseException {
-        String beginDateStr = allocationMapper.getUserAllocation(token.getAccountId()).getAuthBeginTime();
-        Date beginDate = DateUtils.parseDate(beginDateStr,DateUtils.WEB_FORMAT);
-        Date endDate = DateUtils.addDay(new Date(),-1);
-        while (!beginDate.after(endDate)){
-            beginDate = DateUtils.addDay(beginDate,1);
-            getAdvertiserReportHourly(token, beginDate, endDate);
-            getAdvertiserReportDaily(token, beginDate, endDate, null);
-        }
-//        Date endDate = new Date();
-//        for (int i = 0; i < 7; i++) {
-//            Date getStartDate = DateUtils.addDay(endDate, -i);
+        Date endDate = new Date();
+        for (int i = 0; i < 7; i++) {
+            Date getStartDate = DateUtils.addDay(endDate, -i);
             //1: 获取广告主信息数据
-//            getAdvertiserReportHourly(token, beginDate, endDate);
-//            getAdvertiserReportDaily(token, beginDate, endDate, null);
+            getAdvertiserReportHourly(token, getStartDate, getStartDate);
+            getAdvertiserReportDaily(token, getStartDate, getStartDate, null);
             //2:获取广告计划信息数据
             // getAdvertiserCampaignReportHourly(token, getStartDate, getStartDate);
             //3:获取广告组信息数据
             // getAdvertiserGroupReportHourly(token, getStartDate, getStartDate);
             //4: 获取广告创意信息数据
             // getAdvertiserCreativeReportHourly(token, getStartDate, getStartDate);
-//        }
+        }
         //获取全量广告计划数据
         getCampaignList(token, null, null);
         //获取全量广组主数据

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

@@ -444,18 +444,11 @@ public class ReportServiceImpl implements IReportService {
 
     @Override
     public void loadBytedanceHistoryData(CtopOauthToken token) {
-        String beginDateStr = allocationMapper.getUserAllocation(token.getAccountId()).getAuthBeginTime();
-        Date beginDate = DateUtils.parseDate(beginDateStr,DateUtils.WEB_FORMAT);
-        Date endDate2 = DateUtils.addDay(new Date(),-1);
-        while (!beginDate.after(endDate2)){
-            beginDate = DateUtils.addDay(beginDate,1);
-//        for (int i = 1; i < 180; i++) {
-            Date getDate = DateUtils.addDay(new Date(),1);
-            this.getAdvertiserCreativeReport(token, beginDate, endDate2, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-            this.getAdvertiserPlanReport(token, beginDate, endDate2, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-            this.getAdvertiserReport(token, beginDate, endDate2, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-//        }
-
+        for (int i = 1; i < 180; i++) {
+            Date getDate = DateUtils.addDay(new Date(),-i);
+            this.getAdvertiserCreativeReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+            this.getAdvertiserPlanReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+            this.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
         }
 
         try {