|
@@ -1,6 +1,7 @@
|
|
package cn.com.ctop.toutiao.entity;
|
|
package cn.com.ctop.toutiao.entity;
|
|
|
|
|
|
-import cn.com.ctop.common.module.utils.Check;
|
|
|
|
|
|
+import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.annotation.TableId;
|
|
import com.baomidou.mybatisplus.annotation.TableId;
|
|
import com.baomidou.mybatisplus.annotation.TableName;
|
|
import com.baomidou.mybatisplus.annotation.TableName;
|
|
@@ -12,6 +13,7 @@ import lombok.experimental.Accessors;
|
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
+import java.util.Date;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 今日头条广告计划信息
|
|
* 今日头条广告计划信息
|
|
@@ -219,10 +221,22 @@ public class ByteDanceAdvertisePlan {
|
|
*/
|
|
*/
|
|
@Excel(name = "audience", width = 15)
|
|
@Excel(name = "audience", width = 15)
|
|
@ApiModelProperty(value = "audience")
|
|
@ApiModelProperty(value = "audience")
|
|
- private Object audience;
|
|
|
|
|
|
+ private String audience;
|
|
@Excel(name = "上次修改时间", width = 15)
|
|
@Excel(name = "上次修改时间", width = 15)
|
|
@ApiModelProperty(value = "上次修改时间")
|
|
@ApiModelProperty(value = "上次修改时间")
|
|
private String modifyTime;
|
|
private String modifyTime;
|
|
|
|
+ /**
|
|
|
|
+ * 受众性别
|
|
|
|
+ */
|
|
|
|
+ private String gender;
|
|
|
|
+ /**
|
|
|
|
+ * 受众平台
|
|
|
|
+ */
|
|
|
|
+ private String platform;
|
|
|
|
+
|
|
|
|
+ private Date createTime;
|
|
|
|
+
|
|
|
|
+ private Date updateTime;
|
|
|
|
|
|
public ByteDanceAdvertisePlan(JSONObject dataObject, String accountId) {
|
|
public ByteDanceAdvertisePlan(JSONObject dataObject, String accountId) {
|
|
Long id = dataObject.getLong("id");
|
|
Long id = dataObject.getLong("id");
|
|
@@ -232,7 +246,30 @@ public class ByteDanceAdvertisePlan {
|
|
if (null != name && !"".equals(name.trim())) {
|
|
if (null != name && !"".equals(name.trim())) {
|
|
this.name = name;
|
|
this.name = name;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ JSONObject audience = dataObject.getJSONObject("audience");
|
|
|
|
+ if (null != audience) {
|
|
|
|
+ this.audience = audience.toJSONString();
|
|
|
|
+ JSONArray platform = audience.getJSONArray("platform");
|
|
|
|
+ if (null != platform && platform.size() > 0) {
|
|
|
|
+ String plat = "";
|
|
|
|
+ for (int i = 0; i < platform.size(); i++) {
|
|
|
|
+ plat += platform.getString(i) + ",";
|
|
|
|
+ }
|
|
|
|
+ this.platform = plat.substring(0, plat.length() - 1);
|
|
|
|
+ }
|
|
|
|
+ String gender = audience.getString("gender");
|
|
|
|
+ if (null != gender) {
|
|
|
|
+ if (CtopAdConstant.BYTEDANCE_GENDER_TYPE_NONE.equals(gender)) {
|
|
|
|
+ this.gender = "不限";
|
|
|
|
+ } else if (CtopAdConstant.BYTEDANCE_GENDER_TYPE_GENDER_MALE.equals(gender)) {
|
|
|
|
+ this.gender = "男";
|
|
|
|
+ } else {
|
|
|
|
+ this.gender = "女";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.createTime = new Date();
|
|
|
|
+ this.updateTime = new Date();
|
|
Long advertiserId = dataObject.getLong("advertiser_id");
|
|
Long advertiserId = dataObject.getLong("advertiser_id");
|
|
if (null != advertiserId) {
|
|
if (null != advertiserId) {
|
|
this.toutiaoId = advertiserId;
|
|
this.toutiaoId = advertiserId;
|