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

import com.alibaba.fastjson.JSONObject;
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.jeecg.common.util.DateUtils;
import org.jeecgframework.poi.excel.annotation.Excel;

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

/**
 * 广告主小时级别报表信息
 *
 * @author jeecg-boot
 * @version V1.0
 * @date 2019-09-10
 */
@Data
@TableName("ctop_bytedance_report_advertiser_hourly")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "ctop_bytedance_report_advertiser_hourly对象", description = "广告主小时级别报表信息")
public class BytedanceAdvertiserHourlyReport {

    /**
     * id
     */
    @TableId
    @ApiModelProperty(value = "id")
    private String id;
    /**
     * 广告主id
     */
    @Excel(name = "广告主id", width = 15)
    @ApiModelProperty(value = "广告主id")
    private Long advertiserId;
    /**
     * 数据起始时间
     */
    @Excel(name = "数据起始时间", width = 15)
    @ApiModelProperty(value = "数据起始时间")
    private String statDatetime;


    private Integer statHour;
    /**
     * 展示量
     */
    @Excel(name = "展示量", width = 15)
    @ApiModelProperty(value = "展示量")
    private Long showNum;
    /**
     * 点击量
     */
    @Excel(name = "点击量", width = 15)
    @ApiModelProperty(value = "点击量")
    private Long click;
    /**
     * 转化量
     */
    @Excel(name = "转化量", width = 15)
    @ApiModelProperty(value = "转化量")
    private Long convertNum;
    /**
     * 总花费
     */
    @Excel(name = "总花费", width = 15)
    @ApiModelProperty(value = "总花费")
    private BigDecimal cost;
    /**
     * 应用下载-激活
     */
    @Excel(name = "应用下载-激活", width = 15)
    @ApiModelProperty(value = "应用下载-激活")
    private Long active;
    /**
     * 应用下载-安卓下载完成
     */
    @Excel(name = "应用下载-安卓下载完成", width = 15)
    @ApiModelProperty(value = "应用下载-安卓下载完成")
    private Long downloadFinish;
    /**
     * 应用下载-安卓下载开始
     */
    @Excel(name = "应用下载-安卓下载开始", width = 15)
    @ApiModelProperty(value = "应用下载-安卓下载开始")
    private Long downloadStart;
    /**
     * 应用下载-点击安装数
     */
    @Excel(name = "应用下载-点击安装数", width = 15)
    @ApiModelProperty(value = "应用下载-点击安装数")
    private Long clickInstall;
    /**
     * 应用下载-安卓安装完成
     */
    @Excel(name = "应用下载-安卓安装完成", width = 15)
    @ApiModelProperty(value = "应用下载-安卓安装完成")
    private Long installFinish;
    /**
     * 应用下载-注册
     */
    @Excel(name = "应用下载-注册", width = 15)
    @ApiModelProperty(value = "应用下载-注册")
    private Long register;
    /**
     * 应用下载-付费数
     */
    @Excel(name = "应用下载-付费数", width = 15)
    @ApiModelProperty(value = "应用下载-付费数")
    private Long payCount;
    /**
     * 应用下载-到达uv
     */
    @Excel(name = "应用下载-到达uv", width = 15)
    @ApiModelProperty(value = "应用下载-到达uv")
    private Long inAppUv;
    /**
     * 应用下载-详情页到站uv
     */
    @Excel(name = "应用下载-详情页到站uv", width = 15)
    @ApiModelProperty(value = "应用下载-详情页到站uv")
    private Long inAppDetailUv;
    /**
     * 应用下载-加入购物车
     */
    @Excel(name = "应用下载-加入购物车", width = 15)
    @ApiModelProperty(value = "应用下载-加入购物车")
    private Long inAppCart;
    /**
     * 应用下载-提交订单
     */
    @Excel(name = "应用下载-提交订单", width = 15)
    @ApiModelProperty(value = "应用下载-提交订单")
    private Long inAppOrder;
    /**
     * 应用下载-付费
     */
    @Excel(name = "应用下载-付费", width = 15)
    @ApiModelProperty(value = "应用下载-付费")
    private Long inAppPay;
    /**
     * 落地页-电话拨打数
     */
    @Excel(name = "落地页-电话拨打数", width = 15)
    @ApiModelProperty(value = "落地页-电话拨打数")
    private Long phone;
    /**
     * 表单提交数
     */
    @Excel(name = "表单提交数", width = 15)
    @ApiModelProperty(value = "表单提交数")
    private Long form;
    /**
     * 落地页-地图搜索
     */
    @Excel(name = "落地页-地图搜索", width = 15)
    @ApiModelProperty(value = "落地页-地图搜索")
    private Long mapSearch;
    /**
     * 落地页-按钮button
     */
    @Excel(name = "落地页-按钮button", width = 15)
    @ApiModelProperty(value = "落地页-按钮button")
    private Long button;
    /**
     * 落地页-关键页面浏览
     */
    @Excel(name = "落地页-关键页面浏览", width = 15)
    @ApiModelProperty(value = "落地页-关键页面浏览")
    private Long view;
    /**
     * 落地页-QQ咨询数
     */
    @Excel(name = "落地页-QQ咨询数", width = 15)
    @ApiModelProperty(value = "落地页-QQ咨询数")
    private Long qq;
    /**
     * 落地页-抽奖数
     */
    @Excel(name = "落地页-抽奖数", width = 15)
    @ApiModelProperty(value = "落地页-抽奖数")
    private Long lottery;
    /**
     * 落地页-投票
     */
    @Excel(name = "落地页-投票", width = 15)
    @ApiModelProperty(value = "落地页-投票")
    private Long vote;
    /**
     * 落地页-页面跳转
     */
    @Excel(name = "落地页-页面跳转", width = 15)
    @ApiModelProperty(value = "落地页-页面跳转")
    private Long redirect;
    /**
     * 落地页-商品购买
     */
    @Excel(name = "落地页-商品购买", width = 15)
    @ApiModelProperty(value = "落地页-商品购买")
    private Long shopping;
    /**
     * 落地页-在线咨询
     */
    @Excel(name = "落地页-在线咨询", width = 15)
    @ApiModelProperty(value = "落地页-在线咨询")
    private Long consult;
    /**
     * 落地页-微信
     */
    @Excel(name = "落地页-微信", width = 15)
    @ApiModelProperty(value = "落地页-微信")
    private Long wechat;
    /**
     * 落地页-智能电话确认拨打
     */
    @Excel(name = "落地页-智能电话确认拨打", width = 15)
    @ApiModelProperty(value = "落地页-智能电话确认拨打")
    private Long phoneConfirm;
    /**
     * 落地页-智能电话确认接通
     */
    @Excel(name = "落地页-智能电话确认接通", width = 15)
    @ApiModelProperty(value = "落地页-智能电话确认接通")
    private Long phoneConnect;
    /**
     * 落地页-智能电话有效咨询
     */
    @Excel(name = "落地页-智能电话有效咨询", width = 15)
    @ApiModelProperty(value = "落地页-智能电话有效咨询")
    private Long consultEffective;
    /**
     * 视频-总播放
     */
    @Excel(name = "视频-总播放", width = 15)
    @ApiModelProperty(value = "视频-总播放")
    private Long totalPlay;
    /**
     * 视频-有效播放
     */
    @Excel(name = "视频-有效播放", width = 15)
    @ApiModelProperty(value = "视频-有效播放")
    private Long validPlay;
    /**
     * 视频-wifi播放
     */
    @Excel(name = "视频-wifi播放", width = 15)
    @ApiModelProperty(value = "视频-wifi播放")
    private Long wifiPlay;
    /**
     * 视频-播放时长，单位ms
     */
    @Excel(name = "视频-播放时长，单位ms", width = 15)
    @ApiModelProperty(value = "视频-播放时长，单位ms")
    private Long playDurationSum;
    /**
     * 视频-播放25%进度总数
     */
    @Excel(name = "视频-播放25%进度总数", width = 15)
    @ApiModelProperty(value = "视频-播放25%进度总数")
    private Long play25FeedBreak;
    /**
     * 视频-播放50%进度总数
     */
    @Excel(name = "视频-播放50%进度总数", width = 15)
    @ApiModelProperty(value = "视频-播放50%进度总数")
    private Long play50FeedBreak;
    /**
     * 视频-播放75%进度总数
     */
    @Excel(name = "视频-播放75%进度总数", width = 15)
    @ApiModelProperty(value = "视频-播放75%进度总数")
    private Long play75FeedBreak;
    /**
     * 视频-播放100%进度总数
     */
    @Excel(name = "视频-播放100%进度总数", width = 15)
    @ApiModelProperty(value = "视频-播放100%进度总数")
    private Long play100FeedBreak;
    /**
     * 附加创意-电话按钮
     */
    @Excel(name = "附加创意-电话按钮", width = 15)
    @ApiModelProperty(value = "附加创意-电话按钮")
    private Long advancedCreativePhoneClick;
    /**
     * 附加创意-在线咨询
     */
    @Excel(name = "附加创意-在线咨询", width = 15)
    @ApiModelProperty(value = "附加创意-在线咨询")
    private Long advancedCreativeCounselClick;
    /**
     * 附加创意-表单提交
     */
    @Excel(name = "附加创意-表单提交", width = 15)
    @ApiModelProperty(value = "附加创意-表单提交")
    private Long advancedCreativeFormClick;
    /**
     * 互动数据-分享数
     */
    @Excel(name = "互动数据-分享数", width = 15)
    @ApiModelProperty(value = "互动数据-分享数")
    private Long share;
    /**
     * 互动数据-评论数
     */
    @Excel(name = "互动数据-评论数", width = 15)
    @ApiModelProperty(value = "互动数据-评论数")
    private Long comment;
    /**
     * 互动数据-点赞数
     */
    @Excel(name = "互动数据-点赞数", width = 15)
    @ApiModelProperty(value = "互动数据-点赞数")
    private Long likeNum;
    /**
     * 互动数据-关注数
     */
    @Excel(name = "互动数据-关注数", width = 15)
    @ApiModelProperty(value = "互动数据-关注数")
    private Long follow;
    /**
     * 互动数据-主页访问量
     */
    @Excel(name = "互动数据-主页访问量", width = 15)
    @ApiModelProperty(value = "互动数据-主页访问量")
    private Long homeVisited;
    /**
     * 互动数据-挑战赛查看数
     */
    @Excel(name = "互动数据-挑战赛查看数", width = 15)
    @ApiModelProperty(value = "互动数据-挑战赛查看数")
    private Long iesChallengeClick;
    /**
     * 互动数据-音乐查看数
     */
    @Excel(name = "互动数据-音乐查看数", width = 15)
    @ApiModelProperty(value = "互动数据-音乐查看数")
    private Long iesMusicClick;
    /**
     * 互动数据-单次互动成本
     */
    @Excel(name = "互动数据-单次互动成本", width = 15)
    @ApiModelProperty(value = "互动数据-单次互动成本")
    private BigDecimal interactPerCost;
    /**
     * 次留数
     */
    @Excel(name = "次留数", width = 15)
    @ApiModelProperty(value = "次留数")
    private Long nextDayOpen;
    /**
     * 次留率
     */
    @Excel(name = "次留率", width = 15)
    @ApiModelProperty(value = "次留率")
    private BigDecimal nextDayOpenRate;
    /**
     * 次留成本
     */
    @Excel(name = "次留成本", width = 15)
    @ApiModelProperty(value = "次留成本")
    private BigDecimal nextDayOpenCost;
    /**
     * createTime
     */
    @ApiModelProperty(value = "createTime")
    private Date createTime;
    /**
     * updateTime
     */
    @ApiModelProperty(value = "updateTime")
    private Date updateTime;

    public BytedanceAdvertiserHourlyReport(JSONObject data) {
        Long getPlayFeedBreak75 = data.getLong("play_75_feed_break");
        if (null != getPlayFeedBreak75) {
            this.play75FeedBreak = getPlayFeedBreak75;
        }
        Long getNextDayOpen = data.getLong("next_day_open");
        if (null != getNextDayOpen) {
            this.nextDayOpen = getNextDayOpen;
        }
        Long getConvertNum = data.getLong("convert");
        if (null != getConvertNum) {
            this.convertNum = getConvertNum;
        }
        Long getInAppCart = data.getLong("in_app_cart");
        if (null != getInAppCart) {
            this.inAppCart = getInAppCart;
        }
        Long getPlay25FeedBreak = data.getLong("play_25_feed_break");
        if (null != getPlay25FeedBreak) {
            this.play25FeedBreak = getPlay25FeedBreak;
        }
        Long getConsultEffective = data.getLong("consult_effective");
        if (null != getConsultEffective) {
            this.consultEffective = getConsultEffective;
        }
        Long getView = data.getLong("view");
        if (null != getView) {
            this.view = getView;
        }
        Long getPhoneConfirm = data.getLong("phone_confirm");
        if (null != getPhoneConfirm) {
            this.phoneConfirm = getPhoneConfirm;
        }
        Long getIesMusicClick = data.getLong("ies_music_click");
        if (null != getIesMusicClick) {
            this.iesMusicClick = getIesMusicClick;
        }
        Long getWifiPlay = data.getLong("wifi_play");
        if (null != getWifiPlay) {
            this.wifiPlay = getWifiPlay;
        }
        String getStatDatetime = data.getString("stat_datetime");
        if (null != getStatDatetime && !"".equals(getStatDatetime.trim())) {
            try {
                this.statDatetime = DateUtils.getDateByDateStr(getStatDatetime);
                this.statHour = DateUtils.getHour(getStatDatetime);
            } catch (ParseException e) {
                e.printStackTrace();
            }
        }
        Long getShopping = data.getLong("shopping");
        if (null != getShopping) {
            this.shopping = getShopping;
        }
        Long getQq = data.getLong("qq");
        if (null != getQq) {
            this.qq = getQq;
        }
        Long getLike = data.getLong("like");
        if (null != getLike) {
            this.likeNum = getLike;
        }
        Long getPlay50FeedBreak = data.getLong("play_50_feed_break");
        if (null != getPlay50FeedBreak) {
            this.play50FeedBreak = getPlay50FeedBreak;
        }
        Long getActive = data.getLong("active");
        if (null != getActive) {
            this.active = getActive;
        }
        Long getClick = data.getLong("click");
        if (null != getClick) {
            this.click = getClick;
        }
        Long getAdvancedCreativePhoneClick = data.getLong("advanced_creative_phone_click");
        if (null != getAdvancedCreativePhoneClick) {
            this.advancedCreativePhoneClick = getAdvancedCreativePhoneClick;
        }
        Long getDownloadStart = data.getLong("download_start");
        if (null != getDownloadStart) {
            this.downloadStart = getDownloadStart;
        }
        Long getHomeVisited = data.getLong("home_visited");
        if (null != getHomeVisited) {
            this.homeVisited = getHomeVisited;
        }
        Long getPhone = data.getLong("phone");
        if (null != getPhone) {
            this.phone = getPhone;
        }
        Long getInAppPay = data.getLong("in_app_pay");
        if (null != getInAppPay) {
            this.inAppPay = getInAppPay;
        }
        BigDecimal getNextDayOpenCost = data.getBigDecimal("next_day_open_cost");
        if (null != getNextDayOpenCost) {
            this.nextDayOpenCost = getNextDayOpenCost;
        }
        Long getIesChallengeClick = data.getLong("ies_challenge_click");
        if (null != getIesChallengeClick) {
            this.iesChallengeClick = getIesChallengeClick;
        }
        Long getTotalPlay = data.getLong("total_play");
        if (null != getTotalPlay) {
            this.totalPlay = getTotalPlay;
        }
        Long getShow = data.getLong("show");
        if (null != getShow) {
            this.showNum = getShow;
        }
        BigDecimal getNextDayOpenRate = data.getBigDecimal("next_day_open_rate");
        if (null != getNextDayOpenRate) {
            this.nextDayOpenRate = getNextDayOpenRate;
        }
        Long getMapSearch = data.getLong("map_search");
        if (null != getMapSearch) {
            this.mapSearch = getMapSearch;
        }
        Long getClickInstall = data.getLong("click_install");
        if (null != getClickInstall) {
            this.clickInstall = getClickInstall;
        }
        BigDecimal getInteractPerCost = data.getBigDecimal("interact_per_cost");
        if (null != getInteractPerCost) {
            this.interactPerCost = getInteractPerCost;
        }
        Long getAdvertiserId = data.getLong("advertiser_id");
        if (null != getAdvertiserId) {
            this.advertiserId = getAdvertiserId;
        }
        Long getButton = data.getLong("button");
        if (null != getButton) {
            this.button = getButton;
        }
        Long getPlayDurationSum = data.getLong("play_duration_sum");
        if (null != getPlayDurationSum) {
            this.playDurationSum = getPlayDurationSum;
        }
        Long getPlay100FeedBreak = data.getLong("play_100_feed_break");
        if (null != getPlay100FeedBreak) {
            this.play100FeedBreak = getPlay100FeedBreak;
        }
        Long getAdvancedCreativeCounselClick = data.getLong("advanced_creative_counsel_click");
        if (null != getAdvancedCreativeCounselClick) {
            this.advancedCreativeCounselClick = getAdvancedCreativeCounselClick;
        }
        Long getShare = data.getLong("share");
        if (null != getShare) {
            this.share = getShare;
        }
        Long getConsult = data.getLong("consult");
        if (null != getConsult) {
            this.consult = getConsult;
        }
        Long getVote = data.getLong("vote");
        if (null != getVote) {
            this.vote = getVote;
        }
        Long getValidPlay = data.getLong("valid_play");
        if (null != getValidPlay) {
            this.validPlay = getValidPlay;
        }
        Long getRedirect = data.getLong("redirect");
        if (null != getRedirect) {
            this.redirect = getRedirect;
        }
        Long getPayCount = data.getLong("pay_count");
        if (null != getPayCount) {
            this.payCount = getPayCount;
        }
        Long getAdvancedCreativeFormClick = data.getLong("advanced_creative_form_click");
        if (null != getAdvancedCreativeFormClick) {
            this.advancedCreativeFormClick = getAdvancedCreativeFormClick;
        }
        BigDecimal getCost = data.getBigDecimal("cost");
        if (null != getCost) {
            this.cost = getCost;
        }
        Long getDownloadFinish = data.getLong("download_finish");
        if (null != getDownloadFinish) {
            this.downloadFinish = getDownloadFinish;
        }
        Long getWechat = data.getLong("wechat");
        if (null != getWechat) {
            this.wechat = getWechat;
        }
        Long getLottery = data.getLong("lottery");
        if (null != getLottery) {
            this.lottery = getLottery;
        }
        Long getInAppOrder = data.getLong("in_app_order");
        if (null != getInAppOrder) {
            this.inAppOrder = getInAppOrder;
        }
        Long getInstallFinish = data.getLong("install_finish");
        if (null != getInstallFinish) {
            this.installFinish = getInstallFinish;
        }
        Long getFollow = data.getLong("follow");
        if (null != getFollow) {
            this.follow = getFollow;
        }
        Long getInAppDetailUv = data.getLong("in_app_detail_uv");
        if (null != getInAppDetailUv) {
            this.inAppDetailUv = getInAppDetailUv;
        }
        Long getForm = data.getLong("form");
        if (null != getForm) {
            this.form = getForm;
        }
        Long getComment = data.getLong("comment");
        if (null != getComment) {
            this.comment = getComment;
        }
        Long getInAppUv = data.getLong("in_app_uv");
        if (null != getInAppUv) {
            this.inAppUv = getInAppUv;
        }
        Long getRegister = data.getLong("register");
        if (null != getRegister) {
            this.register = getRegister;
        }
        this.id = "" + advertiserId + this.statDatetime + "_" + this.statHour;
        this.createTime = new Date();
        this.updateTime = new Date();
    }

    public BytedanceAdvertiserHourlyReport() {
    }


}
