yumeng 4 年 前
コミット
2486c9151f

+ 47 - 33
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/CollectionSlogans.java

@@ -1,63 +1,77 @@
 package cn.com.ctop.kuaishou.modules.batch.entity;
 
-import java.io.Serializable;
-import java.util.Date;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
 
 /**
  * 收藏的广告语
+ *
  * @author jeecg-boot
- * @date   2020-10-12
  * @version V1.0
+ * @date 2020-10-12
  */
 @Data
 @TableName("ctop_kuaishou_slogans_collection")
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
-@ApiModel(value="ctop_kuaishou_slogans_collection对象", description="收藏的广告语")
+@ApiModel(value = "ctop_kuaishou_slogans_collection对象", description = "收藏的广告语")
 public class CollectionSlogans {
-    
-	/**主键*/
-	@TableId(type = IdType.AUTO)
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.AUTO)
     @ApiModelProperty(value = "主键")
-	private Integer id;
-	/**类型1-封面广告语;2-广告语*/
-	@Excel(name = "类型1-封面广告语;2-广告语", width = 15)
+    private Long id;
+    /**
+     * 类型1-封面广告语;2-广告语
+     */
+    @Excel(name = "类型1-封面广告语;2-广告语", width = 15)
     @ApiModelProperty(value = "类型1-封面广告语;2-广告语")
-	private String type;
-	/**value*/
-	@Excel(name = "value", width = 15)
+    private String type;
+    /**
+     * value
+     */
+    @Excel(name = "value", width = 15)
     @ApiModelProperty(value = "value")
-	private String value;
-	/**人员ID*/
-	@Excel(name = "人员ID", width = 15)
+    private String value;
+    /**
+     * 人员ID
+     */
+    @Excel(name = "人员ID", width = 15)
     @ApiModelProperty(value = "人员ID")
-	private String userId;
-	/**账户ID*/
-	@Excel(name = "账户ID", width = 15)
+    private String userId;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
     @ApiModelProperty(value = "账户ID")
-	private Integer accountId;
-	/**createTime*/
-	@Excel(name = "createTime", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private Long accountId;
+    /**
+     * createTime
+     */
+    @Excel(name = "createTime", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "createTime")
-	private Date createTime;
-	/**updateTime*/
-	@Excel(name = "updateTime", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @Excel(name = "updateTime", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "updateTime")
-	private Date updateTime;
+    private Date updateTime;
 }

+ 21 - 11
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/BatchServiceImpl.java

@@ -1072,7 +1072,13 @@ public class BatchServiceImpl implements IBatchService {
                 creativeJson.put("action_bar_text", action_bar_text);
                 creativeJson.put("description", description.trim());
                 creativeJson.put("creative_name", name);
-                //  creativeJson.put("click_track_url", click_track_url);
+                String imageToken = null;
+                if (!Check.isNull(creative.getStickerTitle()) && !Check.isNull(creative.getOverlayType())) {
+                    imageToken = creative.getOverlayBgImageToken();
+                } else {
+                    imageToken = creative.getImageToken();
+                }
+
 
                 //封面广告语标题
                 if (!Check.isNull(creative.getStickerTitle())) {
@@ -1083,6 +1089,7 @@ public class BatchServiceImpl implements IBatchService {
                     creativeJson.put("overlay_type", creative.getOverlayType());
                 }
 
+
                 // 第三方有效播放监测链接
                 if (!Check.isNull(creative.getAdPhotoPlayedT3sUrl())) {
                     creativeJson.put("ad_photo_played_t3s_url", creative.getAdPhotoPlayedT3sUrl());
@@ -1117,8 +1124,7 @@ public class BatchServiceImpl implements IBatchService {
                             } else {
                                 String photo_id = creative.getPhotoId();
                                 creativeJson.put("photo_id", photo_id);
-                                String image = creative.getImageToken();
-                                creativeJson.put("image_token", image);
+                                creativeJson.put("image_token", imageToken);
                                 creativeJson.put("click_track_url", clickTrackUrl);
 
                             }
@@ -1137,8 +1143,7 @@ public class BatchServiceImpl implements IBatchService {
                             } else {
                                 String photo_id = creative.getPhotoId();
                                 creativeJson.put("photo_id", photo_id);
-                                String image = creative.getImageToken();
-                                creativeJson.put("image_token", image);
+                                creativeJson.put("image_token", imageToken);
                                 if (!Check.isNull(click_track_url)) {
                                     creativeJson.put("click_track_url", click_track_url);
                                 }
@@ -1159,8 +1164,8 @@ public class BatchServiceImpl implements IBatchService {
                         } else {
                             String photo_id = creative.getPhotoId();
                             creativeJson.put("photo_id", photo_id);
-                            String image = creative.getImageToken();
-                            creativeJson.put("image_token", image);
+                            creativeJson.put("image_token", imageToken);
+
                             if (!Check.isNull(click_track_url)) {
                                 creativeJson.put("click_track_url", click_track_url);
                             }
@@ -1186,8 +1191,7 @@ public class BatchServiceImpl implements IBatchService {
                     } else {
                         String photo_id = creative.getPhotoId();
                         creativeJson.put("photo_id", photo_id);
-                        String image = creative.getImageToken();
-                        creativeJson.put("image_token", image);
+                        creativeJson.put("image_token", imageToken);
                         if (!Check.isNull(click_track_url)) {
                             creativeJson.put("click_track_url", click_track_url);
                         }
@@ -1285,6 +1289,8 @@ public class BatchServiceImpl implements IBatchService {
 
                 String creativeMaterialType = dataJson.getString("creativeMaterialType");
                 String shortSlogan = dataJson.getString("shortSlogan");
+                String overlayType = dataJson.getString("overlayType");
+                String stickerTitle = dataJson.getString("stickerTitle");
 
 
                 if (!Check.isNull(dataJsons)) {
@@ -1309,6 +1315,12 @@ public class BatchServiceImpl implements IBatchService {
                                     creativeJson.put("creative_material_type", creativeMaterialType);
                                 }
 
+                                if (!Check.isNull(overlayType)) {
+                                    creativeJson.put("overlay_type", overlayType);
+                                }
+                                if (!Check.isNull(stickerTitle)) {
+                                    creativeJson.put("sticker_title", stickerTitle);
+                                }
                                 if (creativeMaterialType.equals("4")) {
                                     if (!Check.isNull("shortSlogan")) {
                                         creativeJson.put("short_slogan", shortSlogan);
@@ -1795,10 +1807,8 @@ public class BatchServiceImpl implements IBatchService {
         headers.put("Access-Token", accessToken);
         Map<String, Object> param = new HashMap<String, Object>();
         param.put("advertiser_id", accountId);
-
         String result = HttpUtils.httpPostRequest(url, param, headers);
         JSONObject resultJson = JSONObject.parseObject(result);
-        log.info("获取贴纸样式,accountId:{},data:{}", accountId, resultJson);
         if (!Check.isNull(resultJson)) {
             Integer code = resultJson.getInteger("code");
             if (code == 0) {

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

@@ -29,7 +29,7 @@ public class CollectionSlogansServiceImpl extends ServiceImpl<CollectionSlogansM
     public void saveCollectionSlogans(JSONObject requestJson) {
         CollectionSlogans co = new CollectionSlogans();
         String userId = requestJson.getString("userId");
-        Integer accountId = requestJson.getInteger("accountId");
+        Long accountId = requestJson.getLong("accountId");
         if (!Check.isNull(requestJson.getJSONArray("coverSlogansList"))) {
             //封面广告语
             co.setType(NoEn.NO1.valueStr());