package cn.com.ctop.kuaishou.modules.report.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Description: 快手平台广告组信息
 * @Author: jeecg-boot
 * @Date: 2019-08-23
 * @Version: V1.0
 */
@Data
@TableName("ctop_kuaishou_platform_campaign_statistic_info")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "ctop_kuaishou_platform_campaign_statistic_info对象", description = "快手平台广告组信息")
public class PlatformCampaignStatisticInfo {

    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "id")
    private Long id;
    /**
     * 用户id
     */
    @Excel(name = "用户id", width = 15)
    @ApiModelProperty(value = "用户id")
    private Long accountId;
    /**
     * 统计日期
     */
    @Excel(name = "统计日期", width = 15)
    @ApiModelProperty(value = "统计日期")
    private String statisticDate;
    /**
     * 广告计划
     */
    @Excel(name = "广告计划", width = 15)
    @ApiModelProperty(value = "广告计划")
    private String planInfo;
    /**
     * 广告组
     */
    @Excel(name = "广告组", width = 15)
    @ApiModelProperty(value = "广告组")
    private String campaignInfo;
    /**
     * 广告组code
     */
    @Excel(name = "广告组code", width = 15)
    @ApiModelProperty(value = "广告组code")
    private String campaignCode;
    /**
     * 花费
     */
    @Excel(name = "花费", width = 15)
    @ApiModelProperty(value = "花费")
    private BigDecimal cost;
    /**
     * 封面曝光数
     */
    @Excel(name = "封面曝光数", width = 15)
    @ApiModelProperty(value = "封面曝光数")
    private Integer coverExposure;
    /**
     * 封面点击数
     */
    @Excel(name = "封面点击数", width = 15)
    @ApiModelProperty(value = "封面点击数")
    private Integer coverClick;
    /**
     * 素材曝光数
     */
    @Excel(name = "素材曝光数", width = 15)
    @ApiModelProperty(value = "素材曝光数")
    private Integer metarialExposure;
    /**
     * 行为数
     */
    @Excel(name = "行为数", width = 15)
    @ApiModelProperty(value = "行为数")
    private Integer action;
    /**
     * 封面点击率
     */
    @Excel(name = "封面点击率", width = 15)
    @ApiModelProperty(value = "封面点击率")
    private String coverClickRate;
    /**
     * 行为率
     */
    @Excel(name = "行为率", width = 15)
    @ApiModelProperty(value = "行为率")
    private String actionRate;
    /**
     * 平均千次封面曝光花费
     */
    @Excel(name = "平均千次封面曝光花费", width = 15)
    @ApiModelProperty(value = "平均千次封面曝光花费")
    private BigDecimal thousandsCoverExposureCost;
    /**
     * 平均封面点击单价
     */
    @Excel(name = "平均封面点击单价", width = 15)
    @ApiModelProperty(value = "平均封面点击单价")
    private BigDecimal averageCoverClickCost;
    /**
     * 平均行为单价
     */
    @Excel(name = "平均行为单价", width = 15)
    @ApiModelProperty(value = "平均行为单价")
    private BigDecimal averageActionCost;
    /**
     * 提交按钮点击
     */
    @Excel(name = "提交按钮点击", width = 15)
    @ApiModelProperty(value = "提交按钮点击")
    private Integer submitButtonClick;
    /**
     * 表单提交率
     */
    @Excel(name = "表单提交率", width = 15)
    @ApiModelProperty(value = "表单提交率")
    private String formSubmissionRate;
    /**
     * 表单提交单价
     */
    @Excel(name = "表单提交单价", width = 15)
    @ApiModelProperty(value = "表单提交单价")
    private BigDecimal formSubmissionPrice;
    /**
     * 落地页完成件数
     */
    @Excel(name = "落地页完成件数", width = 15)
    @ApiModelProperty(value = "落地页完成件数")
    private Integer pageCompleteNum;
    /**
     * 落地页完件成本
     */
    @Excel(name = "落地页完件成本", width = 15)
    @ApiModelProperty(value = "落地页完件成本")
    private BigDecimal pageCompleteCost;
    /**
     * 落地页授信数
     */
    @Excel(name = "落地页授信数", width = 15)
    @ApiModelProperty(value = "落地页授信数")
    private Integer pageCreditNum;

    @Excel(name = "落地页授信成本", width = 15)
    @ApiModelProperty(value = "落地页授信成本")
    private BigDecimal pageCreditCost;
    /**
     * 落地页授信率
     */
    @Excel(name = "落地页授信率", width = 15)
    @ApiModelProperty(value = "落地页授信率")
    private String pageCreditRate;
    /**
     * createTime
     */
    @ApiModelProperty(value = "createTime")
    private Date createTime;
    /**
     * updateTime
     */
    @ApiModelProperty(value = "updateTime")
    private Date updateTime;

    public PlatformCampaignStatisticInfo() {
    }

    public PlatformCampaignStatisticInfo(String[] record, Long accountId) {

        this.accountId = accountId;
        if (null != record[0] && !"".equals(record[0])) {

            this.statisticDate = record[0];
            this.planInfo = record[1];
            String campaignInfo = record[2];
            this.campaignInfo = campaignInfo;
            if (null != campaignInfo && !"".equals(campaignInfo)) {
                if (campaignInfo.indexOf("-") >= 0) {
                    this.campaignCode = campaignInfo.substring(0, campaignInfo.indexOf("-"));
                } else {
                    this.campaignCode = campaignInfo;
                }
            } else {
                this.campaignCode = "";
            }
            if (null != record[3] && !"".equals(record[3])) {
                this.cost = new BigDecimal(record[3]);
            }
            if (null != record[4] && !"".equals(record[4])) {
                this.coverExposure = Integer.parseInt(record[4]);
            }
            if (null != record[5] && !"".equals(record[5])) {
                this.coverClick = Integer.parseInt(record[5]);
            }
            if (null != record[6] && !"".equals(record[6])) {
                this.metarialExposure = Integer.parseInt(record[6]);
            }
            if (null != record[7] && !"".equals(record[7])) {
                this.action = Integer.parseInt(record[7]);
            }
            if (null != record[8] && !"".equals(record[8])) {
                this.coverClickRate = record[8];
            }
            if (null != record[9] && !"".equals(record[9])) {
                this.actionRate = record[9];
            }
            if (null != record[10] && !"".equals(record[10])) {
                this.thousandsCoverExposureCost = new BigDecimal(record[10]);
            }
            if (null != record[11] && !"".equals(record[11])) {
                this.averageCoverClickCost = new BigDecimal(record[11]);
            }
            if (null != record[12] && !"".equals(record[12])) {
                this.averageActionCost = new BigDecimal(record[12]);
            }
            if (null != record[13] && !"".equals(record[13])) {
                this.submitButtonClick = Integer.parseInt(record[13]);
            }
            if (null != record[14] && !"".equals(record[14])) {
                this.formSubmissionRate = record[14];
            }

            if (null != record[15] && !"".equals(record[15])) {
                this.formSubmissionPrice = new BigDecimal(record[15]);
            }
            if (null != record[16] && !"".equals(record[16])) {
                this.pageCompleteNum = Integer.parseInt(record[16]);
            }
            if (null != record[17] && !"".equals(record[17])) {
                this.pageCompleteCost = new BigDecimal(record[17]);
            }
            if (null != record[18] && !"".equals(record[18])) {
                this.pageCreditNum = Integer.parseInt(record[18]);
            }
            if (null != record[19] && !"".equals(record[19])) {
                this.pageCreditCost = new BigDecimal(record[19]);
            }
            if (null != record[20] && !"".equals(record[20])) {
                this.pageCreditRate = record[20];
            }

            this.createTime = new Date();
            this.updateTime = new Date();
        }
    }
}
