Forráskód Böngészése

快手文件解析可下载近6个月数据

yumeng 4 éve
szülő
commit
6e37fef4bd

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

@@ -1021,39 +1021,17 @@ public class TestController {
     }
 
 
-    @GetMapping(value = "/createTask")
-    public String createTask(Long accountId) {
-        Result<String> result = new Result<String>();
-        try {
-            QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
-            oauthTokenQueryWrapper.eq("media_id", 2);
-            oauthTokenQueryWrapper.eq("account_id", accountId);
-            oauthTokenQueryWrapper.last("limit 1");
-            CtopOauthToken token = tokenMapper.selectOne(oauthTokenQueryWrapper);
-            String endDateStr = DateUtils.getDate("yyyy-MM-dd");
-            String startDate = DateUtils.addMonth(endDateStr, -6);
-            historyReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), startDate, endDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
-
-        } catch (Exception e) {
-            e.printStackTrace();
-            result.setSuccess(false);
-        }
-        return "success";
-    }
-
-
     @GetMapping(value = "/getHistoryData")
-    public String getHistoryData() {
+    public String getHistoryData(String startDate, String endDate) {
         Result<String> result = new Result<>();
         try {
-            String endDateStr = DateUtils.getDate("yyyy-MM-dd");
-            String startDate = DateUtils.addMonth(endDateStr, -6);
+
             QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
             tokenQueryWrapper.eq("media_id", 2);
             List<CtopOauthToken> ctopOauthTokens = tokenMapper.selectList(tokenQueryWrapper);
             if (!Check.isNull(ctopOauthTokens)) {
                 for (CtopOauthToken token : ctopOauthTokens) {
-                    historyReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), "2020-09-01", "2020-10-01", CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
+                    historyReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), startDate, endDate, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
                 }
 
             }

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/utils/ConverterUtils.java

@@ -343,7 +343,7 @@ public class ConverterUtils {
      */
     public static Integer getAsInteger(final Object obj) {
         final Number answer = getAsNumber(obj);
-        if (answer == null) {
+        if (Check.isNull(answer)) {
             return null;
         } else if (answer instanceof Integer) {
             return (Integer) answer;

+ 4 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouReportDailyMaterialService.java

@@ -17,11 +17,13 @@ public interface IKuaiShouReportDailyMaterialService extends IService<KuaiShouRe
 
     List<KuaiShouVideoGetVo> getVideoList(Map<String, Object> requestMap);
 
-    void getMaterialReportByAccountIdAndStatDate(Long accountId, String token, String startDate, String endDate,String temporalGranularity, Integer page);
+    void getMaterialReportByAccountIdAndStatDate(Long accountId, String token, String startDate, String endDate, String temporalGranularity, Integer page);
 
     List<KuaiShouReportDailyMaterial> getSignatureByDate(String date);
 
-    KuaiShouReportDailyMaterial getEtlDataByParams(String signature, String date,Long projectId);
+    KuaiShouReportDailyMaterial getEtlDataByParams(String signature, String date, Long projectId);
 
     List<KuaiShouReportDailyMaterial> getSignatureByDateGroupByProjectId(String date);
+
+    List<KuaiShouReportDailyMaterial> getVideoInfoByList(List<KuaiShouReportDailyMaterial> addList, List<Long> photoIdList);
 }

+ 156 - 74
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouHistoryReportTaskServiceImpl.java

@@ -9,6 +9,7 @@ import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouHistoryReportTaskMapper
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouReportDailyMaterialMapper;
 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.IKuaiShouReportDailyMaterialService;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount;
@@ -66,6 +67,10 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
 
     @Autowired
     private KuaiShouReportDailyMaterialMapper kuaishouReportDailyMaterialMapper;
+    @Autowired
+    private IKuaiShouReportDailyMaterialService reportDailyMaterialService;
+    @Autowired
+    private KuaiShouReportDailyMaterialMapper dailyMaterialMapper;
 
     @Override
     public void createTask(Long accountId, String token, String startDate, String endDate, String taskType) {
@@ -218,82 +223,159 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
             requestMap.put("task_id", task.getTaskId());
             String localPath = LoadFileUtil.downloadByUrl(requestMap, downloadPath, url, token, fileName);
             ArrayList<String[]> reportList = getReportList(localPath);
-
-
             if (task.getViewType() == 1) {
-                List<KuaishouReportDailyAccount> reportDailyAccounts = new ArrayList<>();
-                for (int row = 0; row < reportList.size(); row++) {
-                    if (Check.isNull(row)) {
-                        continue;
+                if (!Check.isNull(reportList)) {
+                    List<KuaishouReportDailyAccount> reportDailyAccounts = new ArrayList<>();
+                    for (int row = 0; row < reportList.size(); row++) {
+                        if (Check.isNull(row)) {
+                            continue;
+                        }
+                        KuaishouReportDailyAccount reportDailyAccount = new KuaishouReportDailyAccount();
+                        reportDailyAccount.setAccountId(task.getAccountId());
+                        reportDailyAccount.setCharge(ConverterUtils.getAsBigDecimal(reportList.get(row)[1]));
+                        reportDailyAccount.setAdScene(reportList.get(row)[0]);
+                        reportDailyAccount.setPhotoShow(ConverterUtils.getAsLong(reportList.get(row)[2]));
+                        reportDailyAccount.setAclick(ConverterUtils.getAsLong(reportList.get(row)[3]));
+                        reportDailyAccount.setBclick(ConverterUtils.getAsLong(reportList.get(row)[4]));
+                        reportDailyAccount.setPhotoShare(ConverterUtils.getAsLong(reportList.get(row)[5]));
+                        reportDailyAccount.setPhotoComment(ConverterUtils.getAsLong(reportList.get(row)[6]));
+                        reportDailyAccount.setPhotoLike(ConverterUtils.getAsLong(reportList.get(row)[7]));
+                        reportDailyAccount.setFollow(ConverterUtils.getAsLong(reportList.get(row)[8]));
+                        reportDailyAccount.setCancelFollow(ConverterUtils.getAsLong(reportList.get(row)[9]));
+                        reportDailyAccount.setReport(ConverterUtils.getAsLong(reportList.get(row)[10]));
+                        reportDailyAccount.setBlock(ConverterUtils.getAsLong(reportList.get(row)[11]));
+                        reportDailyAccount.setNegative(ConverterUtils.getAsLong(reportList.get(row)[12]));
+                        reportDailyAccount.setDownloadStarted(ConverterUtils.getAsLong(reportList.get(row)[13]));
+                        reportDailyAccount.setDownloadCompleted(ConverterUtils.getAsLong(reportList.get(row)[14]));
+                        reportDailyAccount.setActivation(ConverterUtils.getAsLong(reportList.get(row)[15]));
+                        reportDailyAccount.setSubmit(ConverterUtils.getAsLong(reportList.get(row)[16]));
+                        reportDailyAccount.setStatDate(reportList.get(row)[17]);
+                        reportDailyAccount.setPhotoClick(ConverterUtils.getAsLong(reportList.get(row)[19]));
+                        reportDailyAccount.setPhotoClickRatio(ConverterUtils.getAsDouble(reportList.get(row)[20]));
+                        reportDailyAccount.setActionRatio(ConverterUtils.getAsDouble(reportList.get(row)[21]));
+                        reportDailyAccount.setImpression1kCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[22]));
+                        reportDailyAccount.setPhotoClickCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[23]));
+                        reportDailyAccount.setActionCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[25]));
+                        reportDailyAccount.setEventPayFirstDay(ConverterUtils.getAsLong(reportList.get(row)[26]));
+                        reportDailyAccount.setEventPayPurchaseAmountFirstDay(ConverterUtils.getAsBigDecimal(reportList.get(row)[27]));
+                        reportDailyAccount.setEventPayFirstDayRoi(ConverterUtils.getAsDouble(reportList.get(row)[28]));
+                        reportDailyAccount.setEventPay(ConverterUtils.getAsLong(reportList.get(row)[29]));
+                        reportDailyAccount.setEventPayPurchaseAmount(ConverterUtils.getAsBigDecimal(reportList.get(row)[30]));
+                        reportDailyAccount.setEventPayRoi(ConverterUtils.getAsDouble(reportList.get(row)[31]));
+                        reportDailyAccount.setEventRegister(ConverterUtils.getAsLong(reportList.get(row)[32]));
+                        reportDailyAccount.setEventRegisterCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[33]));
+                        reportDailyAccount.setEventRegisterRatio(ConverterUtils.getAsDouble(reportList.get(row)[34]));
+                        reportDailyAccount.setEventJinJianApp(ConverterUtils.getAsLong(reportList.get(row)[35]));
+                        reportDailyAccount.setEventJinJianAppCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[36]));
+                        reportDailyAccount.setEventCreditGrantApp(ConverterUtils.getAsLong(reportList.get(row)[37]));
+                        reportDailyAccount.setEventCreditGrantAppCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[38]));
+                        reportDailyAccount.setEventCreditGrantAppRatio(ConverterUtils.getAsDouble(reportList.get(row)[39]));
+                        reportDailyAccount.setEventOrderPaid(ConverterUtils.getAsLong(reportList.get(row)[40]));
+                        reportDailyAccount.setEventOrderPaidPurchaseAmount(ConverterUtils.getAsBigDecimal(reportList.get(row)[41]));
+                        reportDailyAccount.setEventOrderPaidCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[42]));
+                        reportDailyAccount.setFormCount(ConverterUtils.getAsLong(reportList.get(row)[43]));
+                        reportDailyAccount.setFormCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[44]));
+                        reportDailyAccount.setFormActionRatio(ConverterUtils.getAsDouble(reportList.get(row)[45]));
+                        reportDailyAccount.setEventJinJianLandingPage(ConverterUtils.getAsLong(reportList.get(row)[46]));
+                        reportDailyAccount.setEventJinJianLandingPageCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[47]));
+                        reportDailyAccount.setEventCreditGrantLandingPage(ConverterUtils.getAsLong(reportList.get(row)[48]));
+                        reportDailyAccount.setEventCreditGrantLandingPageCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[49]));
+                        reportDailyAccount.setEventCreditGrantLandingRatio(ConverterUtils.getAsDouble(reportList.get(row)[50]));
+                        reportDailyAccount.setEventNextDayStayCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[51]));
+                        reportDailyAccount.setEventNextDayStayRatio(ConverterUtils.getAsBigDecimal(reportList.get(row)[52]));
+                        reportDailyAccount.setEventNextDayStay(ConverterUtils.getAsLong(reportList.get(row)[53]));
+                        reportDailyAccount.setPlay3sRatio(ConverterUtils.getAsDouble(reportList.get(row)[54]));
+                        reportDailyAccount.setEventNewUserPay(ConverterUtils.getAsLong(reportList.get(row)[63]));
+                        reportDailyAccount.setEventNewUserPayCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[64]));
+                        reportDailyAccount.setEventNewUserPayRatio(ConverterUtils.getAsBigDecimal(reportList.get(row)[65]));
+                        reportDailyAccounts.add(reportDailyAccount);
+                    }
+                    if (!Check.isNull(reportDailyAccounts)) {
+                        reportDailyAccountMapper.replaceBatch(reportDailyAccounts);
                     }
-                    KuaishouReportDailyAccount reportDailyAccount = new KuaishouReportDailyAccount();
-                    reportDailyAccount.setAccountId(task.getAccountId());
-                    reportDailyAccount.setCharge(ConverterUtils.getAsBigDecimal(reportList.get(row)[1]));
-                    reportDailyAccount.setAdScene(reportList.get(row)[0]);
-                    reportDailyAccount.setPhotoShow(ConverterUtils.getAsLong(reportList.get(row)[2]));
-                    reportDailyAccount.setAclick(ConverterUtils.getAsLong(reportList.get(row)[3]));
-                    reportDailyAccount.setBclick(ConverterUtils.getAsLong(reportList.get(row)[4]));
-                    reportDailyAccount.setPhotoShare(ConverterUtils.getAsLong(reportList.get(row)[5]));
-                    reportDailyAccount.setPhotoComment(ConverterUtils.getAsLong(reportList.get(row)[6]));
-                    reportDailyAccount.setPhotoLike(ConverterUtils.getAsLong(reportList.get(row)[7]));
-                    reportDailyAccount.setFollow(ConverterUtils.getAsLong(reportList.get(row)[8]));
-                    reportDailyAccount.setCancelFollow(ConverterUtils.getAsLong(reportList.get(row)[9]));
-                    reportDailyAccount.setReport(ConverterUtils.getAsLong(reportList.get(row)[10]));
-                    reportDailyAccount.setBlock(ConverterUtils.getAsLong(reportList.get(row)[11]));
-                    reportDailyAccount.setNegative(ConverterUtils.getAsLong(reportList.get(row)[12]));
-                    reportDailyAccount.setDownloadStarted(ConverterUtils.getAsLong(reportList.get(row)[13]));
-                    reportDailyAccount.setDownloadCompleted(ConverterUtils.getAsLong(reportList.get(row)[14]));
-                    reportDailyAccount.setActivation(ConverterUtils.getAsLong(reportList.get(row)[15]));
-                    reportDailyAccount.setSubmit(ConverterUtils.getAsLong(reportList.get(row)[16]));
-                    reportDailyAccount.setStatDate(reportList.get(row)[17]);
-                    reportDailyAccount.setPhotoClick(ConverterUtils.getAsLong(reportList.get(row)[19]));
-                    reportDailyAccount.setPhotoClickRatio(ConverterUtils.getAsDouble(reportList.get(row)[20]));
-                    reportDailyAccount.setActionRatio(ConverterUtils.getAsDouble(reportList.get(row)[21]));
-                    reportDailyAccount.setImpression1kCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[22]));
-                    reportDailyAccount.setPhotoClickCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[23]));
-                    reportDailyAccount.setActionCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[25]));
-                    reportDailyAccount.setEventPayFirstDay(ConverterUtils.getAsLong(reportList.get(row)[26]));
-                    reportDailyAccount.setEventPayPurchaseAmountFirstDay(ConverterUtils.getAsBigDecimal(reportList.get(row)[27]));
-                    reportDailyAccount.setEventPayFirstDayRoi(ConverterUtils.getAsDouble(reportList.get(row)[28]));
-                    reportDailyAccount.setEventPay(ConverterUtils.getAsLong(reportList.get(row)[29]));
-                    reportDailyAccount.setEventPayPurchaseAmount(ConverterUtils.getAsBigDecimal(reportList.get(row)[30]));
-                    reportDailyAccount.setEventPayRoi(ConverterUtils.getAsDouble(reportList.get(row)[31]));
-                    reportDailyAccount.setEventRegister(ConverterUtils.getAsLong(reportList.get(row)[32]));
-                    reportDailyAccount.setEventRegisterCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[33]));
-                    reportDailyAccount.setEventRegisterRatio(ConverterUtils.getAsDouble(reportList.get(row)[34]));
-                    reportDailyAccount.setEventJinJianApp(ConverterUtils.getAsLong(reportList.get(row)[35]));
-                    reportDailyAccount.setEventJinJianAppCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[36]));
-                    reportDailyAccount.setEventCreditGrantApp(ConverterUtils.getAsLong(reportList.get(row)[37]));
-                    reportDailyAccount.setEventCreditGrantAppCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[38]));
-                    reportDailyAccount.setEventCreditGrantAppRatio(ConverterUtils.getAsDouble(reportList.get(row)[39]));
-                    reportDailyAccount.setEventOrderPaid(ConverterUtils.getAsLong(reportList.get(row)[40]));
-                    reportDailyAccount.setEventOrderPaidPurchaseAmount(ConverterUtils.getAsBigDecimal(reportList.get(row)[41]));
-                    reportDailyAccount.setEventOrderPaidCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[42]));
-                    reportDailyAccount.setFormCount(ConverterUtils.getAsLong(reportList.get(row)[43]));
-                    reportDailyAccount.setFormCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[44]));
-                    reportDailyAccount.setFormActionRatio(ConverterUtils.getAsDouble(reportList.get(row)[45]));
-                    reportDailyAccount.setEventJinJianLandingPage(ConverterUtils.getAsLong(reportList.get(row)[46]));
-                    reportDailyAccount.setEventJinJianLandingPageCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[47]));
-                    reportDailyAccount.setEventCreditGrantLandingPage(ConverterUtils.getAsLong(reportList.get(row)[48]));
-                    reportDailyAccount.setEventCreditGrantLandingPageCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[49]));
-                    reportDailyAccount.setEventCreditGrantLandingRatio(ConverterUtils.getAsDouble(reportList.get(row)[50]));
-                    reportDailyAccount.setEventNextDayStayCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[51]));
-                    reportDailyAccount.setEventNextDayStayRatio(ConverterUtils.getAsBigDecimal(reportList.get(row)[52]));
-                    reportDailyAccount.setEventNextDayStay(ConverterUtils.getAsLong(reportList.get(row)[53]));
-                    reportDailyAccount.setPlay3sRatio(ConverterUtils.getAsDouble(reportList.get(row)[54]));
-                    reportDailyAccount.setEventNewUserPay(ConverterUtils.getAsLong(reportList.get(row)[63]));
-                    reportDailyAccount.setEventNewUserPayCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[64]));
-                    reportDailyAccount.setEventNewUserPayRatio(ConverterUtils.getAsBigDecimal(reportList.get(row)[65]));
-                    reportDailyAccounts.add(reportDailyAccount);
-
-                }
-
-                if (!Check.isNull(reportDailyAccounts)) {
-                    reportDailyAccountMapper.replaceBatch(reportDailyAccounts);
                 }
+            } else if (task.getViewType() == 5) {
+                if (!Check.isNull(reportList)) {
+                    List<KuaiShouReportDailyMaterial> materialList = new ArrayList<>();
+                    List<Long> photoIdList = new ArrayList<>();
+                    for (int row = 0; row < reportList.size(); row++) {
+                        String[] strings = reportList.get(row);
+                        if (Check.isNull(strings)) {
+                            continue;
+                        }
+                        KuaiShouReportDailyMaterial material = new KuaiShouReportDailyMaterial();
+                        material.setAccountId(task.getAccountId());
+                        material.setPhotoId(ConverterUtils.getAsLong(strings[0]));
+                        photoIdList.add(ConverterUtils.getAsLong(strings[0]));
+                        material.setImageToken(strings[1]);
+                        material.setCoverUrl(strings[2]);
+                        material.setPhotoUrl(strings[3]);
+                        // 4
+                        material.setCreativeMaterialTypeString(strings[5]);
+                        material.setAdScene(strings[6]);
+                        material.setCharge(ConverterUtils.getAsBigDecimal(strings[7]));
+                        material.setPhotoShow(ConverterUtils.getAsLong(strings[8]));
+                        material.setAclick(ConverterUtils.getAsLong(strings[9]));
+                        material.setBclick(ConverterUtils.getAsLong(strings[10]));
+                        material.setPhotoShare(ConverterUtils.getAsInteger(strings[11]));
+                        material.setPhotoComment(ConverterUtils.getAsInteger(strings[12]));
+                        material.setPhotoLike(ConverterUtils.getAsInteger(strings[13]));
+                        material.setFollow(ConverterUtils.getAsInteger(strings[14]));
+                        material.setCancelFollow(ConverterUtils.getAsInteger(strings[15]));
+                        material.setReport(ConverterUtils.getAsInteger(strings[16]));
+                        material.setBlock(ConverterUtils.getAsInteger(strings[17]));
+                        material.setNegative(ConverterUtils.getAsInteger(strings[18]));
+                        material.setDownloadStarted(ConverterUtils.getAsInteger(strings[19]));
+                        material.setDownloadCompleted(ConverterUtils.getAsInteger(strings[20]));
+                        material.setActivation(ConverterUtils.getAsInteger(strings[21]));
+                        material.setSubmit(ConverterUtils.getAsInteger(strings[22]));
+                        material.setStatDate(strings[23]);
+                        // 24
+                        material.setPhotoClick(ConverterUtils.getAsLong(strings[25]));
+                        material.setPhotoClickRatio(ConverterUtils.getAsDouble(strings[26]));
+                        material.setActionRatio(ConverterUtils.getAsDouble(strings[27]));
+                        material.setImpression1kCost(ConverterUtils.getAsBigDecimal(strings[28]));
+                        material.setPhotoClickCost(ConverterUtils.getAsBigDecimal(strings[29]));
+                        // material.setClick1(ConverterUtils.getAsBigDecimal(strings[30]));
+                        material.setActionCost(ConverterUtils.getAsBigDecimal(strings[31]));
+                        material.setEventPayFirstDay(ConverterUtils.getAsInteger(strings[32]));
+                        material.setEventPayPurchaseAmountFirstDay(ConverterUtils.getAsBigDecimal(strings[33]));
+                        material.setEventPayFirstDayRoi(ConverterUtils.getAsDouble(strings[34]));
+                        material.setEventPay(ConverterUtils.getAsInteger(strings[35]));
+                        material.setEventPayPurchaseAmount(ConverterUtils.getAsBigDecimal(strings[36]));
+                        material.setEventPayRoi(ConverterUtils.getAsDouble(strings[37]));
+                        material.setEventRegister(ConverterUtils.getAsInteger(strings[38]));
+                        material.setEventRegisterCost(ConverterUtils.getAsBigDecimal(strings[39]));
+                        material.setEventRegisterRatio(ConverterUtils.getAsDouble(strings[40]));
+                        material.setEventJinJianApp(ConverterUtils.getAsInteger(strings[41]));
+                        material.setEventJinJianAppCost(ConverterUtils.getAsBigDecimal(strings[42]));
+                        material.setEventCreditGrantApp(ConverterUtils.getAsInteger(strings[43]));
+                        material.setEventCreditGrantAppCost(ConverterUtils.getAsBigDecimal(strings[44]));
+                        material.setEventCreditGrantAppRatio(ConverterUtils.getAsDouble(strings[45]));
+                        material.setEventOrderPaid(ConverterUtils.getAsInteger(strings[46]));
+                        material.setEventOrderPaidPurchaseAmount(ConverterUtils.getAsBigDecimal(strings[47]));
+                        material.setEventOrderPaidCost(ConverterUtils.getAsBigDecimal(strings[48]));
+                        material.setFormCount(ConverterUtils.getAsInteger(strings[49]));
+                        material.setFormCost(ConverterUtils.getAsBigDecimal(strings[50]));
+                        material.setFormActionRatio(ConverterUtils.getAsDouble(strings[51]));
+                        material.setEventJinJianLandingPage(ConverterUtils.getAsInteger(strings[52]));
+                        material.setEventJinJianLandingPageCost(ConverterUtils.getAsBigDecimal(strings[53]));
+                        material.setEventCreditGrantLandingPage(ConverterUtils.getAsInteger(strings[54]));
+                        material.setEventCreditGrantLandingPageCost(ConverterUtils.getAsBigDecimal(strings[55]));
+                        material.setEventCreditGrantLandingRatio(ConverterUtils.getAsDouble(strings[56]));
+                        material.setEventNextDayStayCost(ConverterUtils.getAsBigDecimal(strings[57]));
+                        material.setEventNextDayStayRatio(ConverterUtils.getAsInteger(strings[58]));
+                        material.setEventNextDayStay(ConverterUtils.getAsInteger(strings[59]));
+                        material.setPlay3sRatio(ConverterUtils.getAsDouble(strings[60]));
+                        materialList.add(material);
+                    }
+                    if (!Check.isNull(materialList)) {
+                        List<KuaiShouReportDailyMaterial> videoInfoByList = reportDailyMaterialService.getVideoInfoByList(materialList, photoIdList);
+                        dailyMaterialMapper.batchReplace(videoInfoByList);
 
+                    }
 
-            } else if (task.getViewType() == 5) {
+                }
 
             }
 
@@ -364,14 +446,13 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
     private ArrayList<String[]> getReportList(String localPath) throws IOException {
         ArrayList<String[]> csvFileList = new ArrayList<String[]>();
         // 定义一个CSV路径
-
         // 创建CSV读对象 例如:CsvReader(文件路径,分隔符,编码格式);
         CsvReader reader = new CsvReader(localPath, ',', Charset.forName("UTF-8"));
         // 跳过表头 如果需要表头的话,这句可以忽略
         reader.readHeaders();
         // 逐行读入除表头的数据
         while (reader.readRecord()) {
-            System.out.println(reader.getRawRecord());
+            //  System.out.println(reader.getRawRecord());
             csvFileList.add(reader.getValues());
         }
         reader.close();
@@ -387,10 +468,11 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
 
         historyTypeList = new ArrayList<>();
         historyTypeList.add(1);
+        historyTypeList.add(5);
       /*  historyTypeList.add(2);
         historyTypeList.add(3);*/
         // historyTypeList.add(4);
-        //    historyTypeList.add(5);
+        //
         // historyTypeList.add(7);
         //  historyTypeList.add(10);
 

+ 2 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouReportDailyMaterialServiceImpl.java

@@ -101,7 +101,8 @@ public class KuaiShouReportDailyMaterialServiceImpl extends ServiceImpl<KuaiShou
         getMaterialReportByAccountIdAndStatDate(accountId, token, startDate, endDate, temporalGranularity, page + 1);
     }
 
-    private List<KuaiShouReportDailyMaterial> getVideoInfoByList(List<KuaiShouReportDailyMaterial> addList, List<Long> photoIdList) {
+    @Override
+    public List<KuaiShouReportDailyMaterial> getVideoInfoByList(List<KuaiShouReportDailyMaterial> addList, List<Long> photoIdList) {
         if (Check.isNull(photoIdList)) {
             return null;
         }

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

@@ -791,18 +791,10 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         getGroupList(token, null, null);
         //获取全量创意数据
         getCreativeList(token, null, null);
-        //获取全量视频素材数据
-
-        //获取图片信息数据
-
-
         getAppList(token.getAccountId(), token.getAccessToken());
-
         log.info("----------------开始历史数据获取,accountId:{}", token.getAccountId());
-
         String endDateStr = DateUtils.getDate("yyyy-MM-dd");
-        String startDate = DateUtils.addMonth(endDateStr, -6);
-
+        String startDate = DateUtils.addMonth(endDateStr, -1);
         historyReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), startDate, endDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
         getVideoList(token, null, null);
         //   getSuZaoList(token.getAccessToken(), token.getAccountId(), 1, null, null);