Przeglądaj źródła

Merge remote-tracking branch 'origin/test' into test

yumeng 5 lat temu
rodzic
commit
b5befe1234

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CreateInternalServiceImpl.java

@@ -479,7 +479,7 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
                             //获取modify_time
                             Thread.sleep(5000L);
                             advertiserDataService.getAdvertiserPlan(bindAccountLogin.getAccountId(), adId + "");
-                            advertiserDataService.updateAd(token, adId, template);
+                            advertiserDataService.updateAd(token, adId, template, requestJson);
                         }
                         Long creativeTemplateId = requestJson.getLong("creativeTemplateId");
 

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

@@ -131,7 +131,6 @@ public class SampleTest {
                 //获取modify_time
                 Thread.sleep(5000L);
                 advertiserDataService.getAdvertiserPlan(accountId, adId + "");
-                advertiserDataService.updateAd(token, adId, template);
             }
         }
     }

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

@@ -23,9 +23,12 @@ public class KuaishouReportDailyAccount implements Serializable {
 
     @JsonProperty
     private BigDecimal charge;
-    @JsonProperty
-    @TableField("`show`")
+    @TableField("photo_show")
     private Long show;
+    @JsonProperty("photo_click")
+    @TableField("photo_click")
+    private Long photoClick;
+
     @JsonProperty
     private Long aclick;
     @JsonProperty

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

@@ -21,9 +21,11 @@ public class KuaishouReportDailyCampaign implements Serializable {
     private String statDate;
     @JsonProperty
     private BigDecimal charge;
-    @JsonProperty
-    @TableField("`show`")
+    @TableField("photo_show")
     private Long show;
+    @JsonProperty("photo_click")
+    @TableField("photo_click")
+    private Long photoClick;
     @JsonProperty
     private Long aclick;
     @JsonProperty

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

@@ -24,9 +24,11 @@ public class KuaishouReportDailyCreative implements Serializable {
     private String statDate;
     @JsonProperty
     private BigDecimal charge;
-    @JsonProperty
-    @TableField("`show`")
+    @TableField("photo_show")
     private Long show;
+    @JsonProperty("photo_click")
+    @TableField("photo_click")
+    private Long photoClick;
     @JsonProperty
     private Long aclick;
     @JsonProperty

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

@@ -25,9 +25,11 @@ public class KuaishouReportDailyGroup implements Serializable {
 
     @JsonProperty
     private BigDecimal charge;
-    @JsonProperty
-    @TableField("`show`")
+    @TableField("photo_show")
     private Long show;
+    @JsonProperty("photo_click")
+    @TableField("photo_click")
+    private Long photoClick;
     @JsonProperty
     private Long aclick;
     @JsonProperty

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

@@ -24,9 +24,11 @@ public class KuaishouReportHourlyAccount implements Serializable {
 
     @JsonProperty
     private BigDecimal charge;
-    @JsonProperty
-    @TableField("`show`")
+    @TableField("photo_show")
     private Long show;
+    @JsonProperty("photo_click")
+    @TableField("photo_click")
+    private Long photoClick;
     @JsonProperty
     private Long aclick;
     @JsonProperty

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

@@ -29,9 +29,11 @@ public class KuaishouReportHourlyCampaign implements Serializable {
 
     @JsonProperty
     private BigDecimal charge;
-    @JsonProperty
-    @TableField("`show`")
+    @TableField("photo_show")
     private Long show;
+    @JsonProperty("photo_click")
+    @TableField("photo_click")
+    private Long photoClick;
     @JsonProperty
     private Long aclick;
     @JsonProperty

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

@@ -24,9 +24,11 @@ public class KuaishouReportHourlyCreative implements Serializable {
     private Integer statHour;
     @JsonProperty
     private BigDecimal charge;
-    @JsonProperty
-    @TableField("`show`")
+    @TableField("photo_show")
     private Long show;
+    @JsonProperty("photo_click")
+    @TableField("photo_click")
+    private Long photoClick;
     @JsonProperty
     private Long aclick;
     @JsonProperty

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

@@ -24,9 +24,11 @@ public class KuaishouReportHourlyGroup implements Serializable {
     private Integer statHour;
     @JsonProperty
     private BigDecimal charge;
-    @JsonProperty
-    @TableField("`show`")
+    @TableField("photo_show")
     private Long show;
+    @JsonProperty("photo_click")
+    @TableField("photo_click")
+    private Long photoClick;
     @JsonProperty
     private Long aclick;
     @JsonProperty

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IByteDanceAdvertiserDataService.java

@@ -38,9 +38,9 @@ public interface IByteDanceAdvertiserDataService {
 
     Map<String, Object> advertiserAdUpdate(String accountId, Long adId, ByteDanceUserOrientationTemplate template);
 
-    JSONObject updateAd(CtopOauthToken token, Long adId, ByteDanceUserOrientationTemplate template);
+    JSONObject updateAd(CtopOauthToken token, Long adId, ByteDanceUserOrientationTemplate template, JSONObject requestJson);
 
-    JSONObject setUserOrentationData(JSONObject data, ByteDanceUserOrientationTemplate template, Long adId);
+    JSONObject setUserOrentationData(JSONObject data, ByteDanceUserOrientationTemplate template, Long adId, JSONObject requestJson);
 
     JSONObject setUserOrentationData(JSONObject data, ByteDanceUserOrientationTemplate template);
 }

+ 21 - 10
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceAdvertiserDataServiceImpl.java

@@ -596,13 +596,6 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
             resultMap.put("code", -1);
             return resultMap;
         }
-//        for (int i = 0; i < data.size(); i++) {
-//            JSONObject dataObject = data.getJSONObject(i);
-//            ByteDanceCustomAudience audience = new ByteDanceCustomAudience(token, dataObject);
-//            audienceMapper.deleteById(audience.getId());
-//            audienceMapper.insert(audience);
-//        }
-
         resultMap.put("success", true);
         resultMap.put("message", "人群包信息获取成功");
         resultMap.put("data", data);
@@ -617,7 +610,7 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
     }
 
     @Override
-    public JSONObject updateAd(CtopOauthToken token, Long adId, ByteDanceUserOrientationTemplate template) {
+    public JSONObject updateAd(CtopOauthToken token, Long adId, ByteDanceUserOrientationTemplate template, JSONObject requestJson) {
 
         // 请求地址
         String url = "https://ad.toutiao.com/open_api/2/ad/update/";
@@ -625,7 +618,7 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         JSONObject data = new JSONObject();
         data.put("advertiser_id", token.getAccountId());
         data.put("ad_id", adId);
-        data = setUserOrentationData(data, template, adId);
+        data = setUserOrentationData(data, template, adId, requestJson);
         return HttpUtils.bytedancePostRequest(token.getAccessToken(), url, data);
     }
 
@@ -633,10 +626,28 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
     private IByteDanceAdvertisePlanService advertisePlanService;
 
     @Override
-    public JSONObject setUserOrentationData(JSONObject data, ByteDanceUserOrientationTemplate template, Long adId) {
+    public JSONObject setUserOrentationData(JSONObject data, ByteDanceUserOrientationTemplate template, Long adId, JSONObject requestJson) {
         //根据adId获取公告计划信息
         ByteDanceAdvertisePlan advertisePlan = advertisePlanService.getById(adId);
         data.put("modify_time", advertisePlan.getModifyTime());
+        JSONArray retargetingTagsExclude = requestJson.getJSONArray("retargetingTagsExclude");
+        JSONArray retargetingTagsInclude = requestJson.getJSONArray("retargetingTagsInclude");
+        if (null != retargetingTagsExclude && retargetingTagsExclude.size() > 0) {
+            JSONArray getRetargetingTagsExclude = new JSONArray();
+            for (int i = 0; i < retargetingTagsExclude.size(); i++) {
+                String exclude = retargetingTagsExclude.getString(i);
+                getRetargetingTagsExclude.add(Long.parseLong(exclude));
+            }
+            data.put("retargeting_tags_exclude", getRetargetingTagsExclude);
+        }
+        if (null != retargetingTagsInclude && retargetingTagsInclude.size() > 0) {
+            JSONArray getRetargetingTagsInclude = new JSONArray();
+            for (int i = 0; i < retargetingTagsInclude.size(); i++) {
+                String include = retargetingTagsInclude.getString(i);
+                getRetargetingTagsInclude.add(Long.parseLong(include));
+            }
+            data.put("retargeting_tags_include", getRetargetingTagsInclude);
+        }
         data = setUserOrentationData(data, template);
         System.out.println(data.toJSONString());
         return data;