瀏覽代碼

添加素材+出价逻辑流程

syh 4 年之前
父節點
當前提交
210f939f6c

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -56,6 +56,7 @@ public class ShiroConfig {
         Map<String, String> filterChainDefinitionMap = new LinkedHashMap<>();
         Map<String, String> filterChainDefinitionMap = new LinkedHashMap<>();
         // 配置不会被拦截的链接 顺序判断
         // 配置不会被拦截的链接 顺序判断
         //登录接口排除
         //登录接口排除
+        filterChainDefinitionMap.put("/ctop/materialInfo/**", "anon");
         filterChainDefinitionMap.put("/sys/mLogin", "anon");
         filterChainDefinitionMap.put("/sys/mLogin", "anon");
         filterChainDefinitionMap.put("/sys/login", "anon");
         filterChainDefinitionMap.put("/sys/login", "anon");
         filterChainDefinitionMap.put("/sys/wxlogin", "anon");
         filterChainDefinitionMap.put("/sys/wxlogin", "anon");

+ 4 - 8
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ads/service/impl/AiStrategyServiceImpl.java

@@ -69,9 +69,6 @@ public class AiStrategyServiceImpl implements IAiStrategyService {
             log.info("token获取失败=>accountId:{}",strategy.getAccountId());
             log.info("token获取失败=>accountId:{}",strategy.getAccountId());
             return;
             return;
         }
         }
-        strategy.setCpaBidMin(1000L);
-        strategy.setCpaBidMax(3000L);
-        strategy.setStepSize(200L);
         //1:获取相应账户下的最新的5条素材信息
         //1:获取相应账户下的最新的5条素材信息
         List<KuaiShouVideoGet> videoGets = videoGetService.getNewVideoByAccountId(accountId,1);
         List<KuaiShouVideoGet> videoGets = videoGetService.getNewVideoByAccountId(accountId,1);
         if(null == videoGets){
         if(null == videoGets){
@@ -119,7 +116,6 @@ public class AiStrategyServiceImpl implements IAiStrategyService {
                         continue;
                         continue;
                     }
                     }
                     Long unitId = (Long) unitCreateResult.get("unitId");
                     Long unitId = (Long) unitCreateResult.get("unitId");
-
                     JSONObject creativeParams = creativeParams(token,unitId,videoItem,unitCnt,strategy);
                     JSONObject creativeParams = creativeParams(token,unitId,videoItem,unitCnt,strategy);
                     JSONArray sceneIdJsonArray = JSONArray.parseArray(strategy.getSceneId());
                     JSONArray sceneIdJsonArray = JSONArray.parseArray(strategy.getSceneId());
                     // 如果广告位只包含 上下滑大屏广告(6),则一个素材搭配1张封面,生成1个创意
                     // 如果广告位只包含 上下滑大屏广告(6),则一个素材搭配1张封面,生成1个创意
@@ -145,7 +141,7 @@ public class AiStrategyServiceImpl implements IAiStrategyService {
                                 creativeParams.put("image_token",imageToken);
                                 creativeParams.put("image_token",imageToken);
                                 createCreative(token,creativeParams,campaignId,unitId,strategy,null,creativeCnt,videoItem);
                                 createCreative(token,creativeParams,campaignId,unitId,strategy,null,creativeCnt,videoItem);
                                 creativeCnt++;
                                 creativeCnt++;
-                                if (creativeCnt > 4) {
+                                if (creativeCnt > 5) {
                                     break;
                                     break;
                                 }
                                 }
                             }
                             }
@@ -159,7 +155,7 @@ public class AiStrategyServiceImpl implements IAiStrategyService {
                                 creativeParams.put("image_token",imageToken);
                                 creativeParams.put("image_token",imageToken);
                                 createCreative(token,creativeParams,campaignId,unitId,strategy,null,creativeCnt,videoItem);
                                 createCreative(token,creativeParams,campaignId,unitId,strategy,null,creativeCnt,videoItem);
                                 creativeCnt ++;
                                 creativeCnt ++;
-                                if (creativeCnt > 4) {
+                                if (creativeCnt > 5) {
                                     break;
                                     break;
                                 }
                                 }
                             }
                             }
@@ -255,7 +251,7 @@ public class AiStrategyServiceImpl implements IAiStrategyService {
                                 creativeParams.put("image_token",imageToken);
                                 creativeParams.put("image_token",imageToken);
                                 createCreative(token,creativeParams,campaignId,unitId,strategy,targetUnion,creativeCnt,videoItem);
                                 createCreative(token,creativeParams,campaignId,unitId,strategy,targetUnion,creativeCnt,videoItem);
                                 creativeCnt++;
                                 creativeCnt++;
-                                if (creativeCnt > 4) {
+                                if (creativeCnt > 5) {
                                     break;
                                     break;
                                 }
                                 }
                             }
                             }
@@ -269,7 +265,7 @@ public class AiStrategyServiceImpl implements IAiStrategyService {
                                 creativeParams.put("image_token",imageToken);
                                 creativeParams.put("image_token",imageToken);
                                 createCreative(token,creativeParams,campaignId,unitId,strategy,targetUnion,creativeCnt,videoItem);
                                 createCreative(token,creativeParams,campaignId,unitId,strategy,targetUnion,creativeCnt,videoItem);
                                 creativeCnt ++;
                                 creativeCnt ++;
-                                if (creativeCnt > 4) {
+                                if (creativeCnt > 5) {
                                     break;
                                     break;
                                 }
                                 }
                             }
                             }

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

@@ -419,7 +419,8 @@ public class SampleTest {
     public void loadKuaishouVideo(){
     public void loadKuaishouVideo(){
         String endDate = DateUtils.getNowDate("yyyy-MM-dd");
         String endDate = DateUtils.getNowDate("yyyy-MM-dd");
         CtopOauthToken token = tokenService.getTokenByAccountId(9743023L);
         CtopOauthToken token = tokenService.getTokenByAccountId(9743023L);
-        kuaishouInterfaceService.getVideoList(token, endDate, endDate);
+//        kuaishouInterfaceService.getVideoList(token, endDate, endDate);
+        kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, new Date(), new Date(), null, null);
     }
     }
 
 
 }
 }

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

@@ -19,7 +19,6 @@ public class LoadFileUtil {
      */
      */
     public static String downLoadFromUrl(String urlStr, String savePath) {
     public static String downLoadFromUrl(String urlStr, String savePath) {
         try {
         try {
-
             String fileName = AesEncryptUtil.getUrlDecoderString(urlStr.substring(urlStr.lastIndexOf("/") + 1));
             String fileName = AesEncryptUtil.getUrlDecoderString(urlStr.substring(urlStr.lastIndexOf("/") + 1));
             URL url = new URL(urlStr);
             URL url = new URL(urlStr);
 
 

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

@@ -753,14 +753,11 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             detailJson.put("photo_like", like);
             detailJson.put("photo_like", like);
             var creative = JSONObject.toJavaObject(detailJson, KuaishouReportDailyCreative.class);
             var creative = JSONObject.toJavaObject(detailJson, KuaishouReportDailyCreative.class);
             creative.setAccountId(token.getAccountId());
             creative.setAccountId(token.getAccountId());
-            creative.setId("" + creative.getAccountId() + creative.getCreativeId() + creative.getStatDate());
             // 取得MD5
             // 取得MD5
             String signature = creativeService.getCodeByCreativeId(creative.getCreativeId());
             String signature = creativeService.getCodeByCreativeId(creative.getCreativeId());
             if (!Check.isNull(signature)) {
             if (!Check.isNull(signature)) {
                 creative.setSignature(signature);
                 creative.setSignature(signature);
             }
             }
-            KuaishouReportDailyCreativeStatistic statistic = setDailyStatistic(creative, token);
-            dailyCreativeStatisticService.saveOrUpdate(statistic);
             dailyCreativeService.saveOrUpdate(creative);
             dailyCreativeService.saveOrUpdate(creative);
         }
         }
         getAdvertiserCreativeReportDailyByPage(token, startDate, endDate, campaignIds, creativeIds, page + 1);
         getAdvertiserCreativeReportDailyByPage(token, startDate, endDate, campaignIds, creativeIds, page + 1);
@@ -817,7 +814,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             List<KuaishouReportDailyCreative> dailyCreatives = kuaishouResult.getData().getDetails();
             List<KuaishouReportDailyCreative> dailyCreatives = kuaishouResult.getData().getDetails();
             dailyCreatives.forEach((creative) -> {
             dailyCreatives.forEach((creative) -> {
                 creative.setAccountId(advertiserId);
                 creative.setAccountId(advertiserId);
-                creative.setId("" + creative.getAccountId() + creative.getCreativeId() + creative.getStatDate());
                 dailyCreativeService.saveOrUpdate(creative);
                 dailyCreativeService.saveOrUpdate(creative);
             });
             });
         } catch (Exception e) {
         } catch (Exception e) {

+ 9 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyCreative.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.kuaishou.modules.report.entity;
 package cn.com.ctop.kuaishou.modules.report.entity;
 
 
+import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -14,11 +15,15 @@ import java.util.Date;
 @TableName("ctop_kuaishou_report_daily_creative")
 @TableName("ctop_kuaishou_report_daily_creative")
 public class KuaishouReportDailyCreative implements Serializable {
 public class KuaishouReportDailyCreative implements Serializable {
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
-    @TableId
-    private String id;
+    @TableId(type = IdType.AUTO)
+    private Long id;
     private Long accountId;
     private Long accountId;
     @JsonProperty("creative_id")
     @JsonProperty("creative_id")
     private Long creativeId;
     private Long creativeId;
+    private Long  unitId;
+    private String unitName;
+    private Long campaignId;
+    private String campaignName;
 
 
     @JsonProperty("stat_date")
     @JsonProperty("stat_date")
     private String statDate;
     private String statDate;
@@ -34,9 +39,9 @@ public class KuaishouReportDailyCreative implements Serializable {
     @JsonProperty
     @JsonProperty
     private Long bclick;
     private Long bclick;
     @JsonProperty
     @JsonProperty
-    private Long share;
+    private Long photoShare;
     @JsonProperty
     @JsonProperty
-    private Long comment;
+    private Long photoComment;
     @JsonProperty
     @JsonProperty
     private Long photoLike;
     private Long photoLike;
     @JsonProperty
     @JsonProperty

+ 2 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyCreativeStatistic.java

@@ -394,7 +394,6 @@ public class KuaishouReportDailyCreativeStatistic {
     private String url;
     private String url;
 
 
     public KuaishouReportDailyCreativeStatistic(KuaishouReportDailyCreative creative) {
     public KuaishouReportDailyCreativeStatistic(KuaishouReportDailyCreative creative) {
-        this.id = creative.getId();
         this.accountId = creative.getAccountId();
         this.accountId = creative.getAccountId();
         this.creativeId = creative.getCreativeId();
         this.creativeId = creative.getCreativeId();
         this.statDate = creative.getStatDate();
         this.statDate = creative.getStatDate();
@@ -431,8 +430,8 @@ public class KuaishouReportDailyCreativeStatistic {
         this.eventPayFirstDay = creative.getEventPayFirstDay();
         this.eventPayFirstDay = creative.getEventPayFirstDay();
         this.photoClickCost = creative.getPhotoClickCost();
         this.photoClickCost = creative.getPhotoClickCost();
         this.actionCost = creative.getActionCost();
         this.actionCost = creative.getActionCost();
-        this.share = creative.getShare();
-        this.comment = creative.getComment();
+        this.share = creative.getPhotoShare();
+        this.comment = creative.getPhotoComment();
         this.photoLike = creative.getPhotoLike();
         this.photoLike = creative.getPhotoLike();
         this.follow = creative.getFollow();
         this.follow = creative.getFollow();
         this.report = creative.getReport();
         this.report = creative.getReport();