package com.xxl.job.executor.report.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

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

/**
 * @Description: 广告计划日报表信息
 * @Author: jeecg-boot
 * @Date: 2019-09-11
 * @Version: V1.0
 */
@Data
@TableName("ctop_bytedance_report_plan_daily")
public class BytedancePlanDailyReport {

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

    /**
     * 素材名称
     */
    private String materialName;

    public BytedancePlanDailyReport(JSONObject data, Long setAdvertiserId) {
        Long playFeedBreak75 = data.getLong("play_75_feed_break");
        if (null != playFeedBreak75) {
            this.play75FeedBreak = playFeedBreak75;
        }
        Long nextDayOpen = data.getLong("attribution_next_day_open_cnt");
        if (null != nextDayOpen) {
            this.nextDayOpen = nextDayOpen;
        }
        Long convert = data.getLong("convert");
        if (null != convert) {
            this.convertNum = convert;
        }
        Long inAppCart = data.getLong("in_app_cart");
        if (null != inAppCart) {
            this.inAppCart = inAppCart;
        }
        Long play25FeedBreak = data.getLong("play_25_feed_break");
        if (null != play25FeedBreak) {
            this.play25FeedBreak = play25FeedBreak;
        }
        Long consultEffective = data.getLong("consult_effective");
        if (null != consultEffective) {
            this.consultEffective = consultEffective;
        }
        Long view = data.getLong("view");
        if (null != view) {
            this.view = view;
        }
        Long phoneConfirm = data.getLong("phone_confirm");
        if (null != phoneConfirm) {
            this.phoneConfirm = phoneConfirm;
        }
        Long iesMusicClick = data.getLong("ies_music_click");
        if (null != iesMusicClick) {
            this.iesMusicClick = iesMusicClick;
        }
        Long wifiPlay = data.getLong("wifi_play");
        if (null != wifiPlay) {
            this.wifiPlay = wifiPlay;
        }
        String statDatetime = data.getString("stat_datetime");
        if (null != statDatetime && !"".equals(statDatetime.trim())) {
            this.statDatetime = statDatetime;
        }
        Long shopping = data.getLong("shopping");
        if (null != shopping) {
            this.shopping = shopping;
        }
        Long qq = data.getLong("qq");
        if (null != qq) {
            this.qq = qq;
        }
        Long like = data.getLong("like");
        if (null != like) {
            this.likeNum = like;
        }
        Long play50FeedBreak = data.getLong("play_50_feed_break");
        if (null != play50FeedBreak) {
            this.play50FeedBreak = play50FeedBreak;
        }
        Long active = data.getLong("active");
        if (null != active) {
            this.active = active;
        }
        Long click = data.getLong("click");
        if (null != click) {
            this.click = click;
        }
        Long advancedCreativePhoneClick = data.getLong("advanced_creative_phone_click");
        if (null != advancedCreativePhoneClick) {
            this.advancedCreativePhoneClick = advancedCreativePhoneClick;
        }
        Long downloadStart = data.getLong("download_start");
        if (null != downloadStart) {
            this.downloadStart = downloadStart;
        }
        Long homeVisited = data.getLong("home_visited");
        if (null != homeVisited) {
            this.homeVisited = homeVisited;
        }
        Long phone = data.getLong("phone");
        if (null != phone) {
            this.phone = phone;
        }
        Long inAppPay = data.getLong("in_app_pay");
        if (null != inAppPay) {
            this.inAppPay = inAppPay;
        }
        BigDecimal nextDayOpenCost = data.getBigDecimal("attribution_next_day_open_cost");
        if (null != nextDayOpenCost) {
            this.nextDayOpenCost = nextDayOpenCost;
        }
        Long iesChallengeClick = data.getLong("ies_challenge_click");
        if (null != iesChallengeClick) {
            this.iesChallengeClick = iesChallengeClick;
        }
        Long totalPlay = data.getLong("total_play");
        if (null != totalPlay) {
            this.totalPlay = totalPlay;
        }
        Long show = data.getLong("show");
        if (null != show) {
            this.showNum = show;
        }
        BigDecimal nextDayOpenRate = data.getBigDecimal("attribution_next_day_open_rate");
        if (null != nextDayOpenRate) {
            this.nextDayOpenRate = nextDayOpenRate;
        }
        Long mapSearch = data.getLong("map_search");
        if (null != mapSearch) {
            this.mapSearch = mapSearch;
        }
        Long clickInstall = data.getLong("click_install");
        if (null != clickInstall) {
            this.clickInstall = clickInstall;
        }
        BigDecimal interactPerCost = data.getBigDecimal("interact_per_cost");
        if (null != interactPerCost) {
            this.interactPerCost = interactPerCost;
        }
        Long advertiserId = data.getLong("advertiser_id");
        if (null != advertiserId) {
            this.advertiserId = advertiserId;
        } else {
            this.advertiserId = setAdvertiserId;
        }
        Long button = data.getLong("button");
        if (null != button) {
            this.button = button;
        }
        Long playDurationSum = data.getLong("play_duration_sum");
        if (null != playDurationSum) {
            this.playDurationSum = playDurationSum;
        }
        Long play100FeedBreak = data.getLong("play_100_feed_break");
        if (null != play100FeedBreak) {
            this.play100FeedBreak = play100FeedBreak;
        }
        Long advancedCreativeCounselClick = data.getLong("advanced_creative_counsel_click");
        if (null != advancedCreativeCounselClick) {
            this.advancedCreativeCounselClick = advancedCreativeCounselClick;
        }
        Long share = data.getLong("share");
        if (null != share) {
            this.share = share;
        }
        Long consult = data.getLong("consult");
        if (null != consult) {
            this.consult = consult;
        }
        Long vote = data.getLong("vote");
        if (null != vote) {
            this.vote = vote;
        }
        Long validPlay = data.getLong("valid_play");
        if (null != validPlay) {
            this.validPlay = validPlay;
        }
        Long redirect = data.getLong("redirect");
        if (null != redirect) {
            this.redirect = redirect;
        }
        Long payCount = data.getLong("pay_count");
        if (null != payCount) {
            this.payCount = payCount;
        }
        Long advancedCreativeFormClick = data.getLong("advanced_creative_form_click");
        if (null != advancedCreativeFormClick) {
            this.advancedCreativeFormClick = advancedCreativeFormClick;
        }
        BigDecimal cost = data.getBigDecimal("cost");
        if (null != cost) {
            this.cost = cost;
        }
        Long downloadFinish = data.getLong("download_finish");
        if (null != downloadFinish) {
            this.downloadFinish = downloadFinish;
        }
        Long wechat = data.getLong("wechat");
        if (null != wechat) {
            this.wechat = wechat;
        }
        Long lottery = data.getLong("lottery");
        if (null != lottery) {
            this.lottery = lottery;
        }
        Long inAppOrder = data.getLong("in_app_order");
        if (null != inAppOrder) {
            this.inAppOrder = inAppOrder;
        }
        Long installFinish = data.getLong("install_finish");
        if (null != installFinish) {
            this.installFinish = installFinish;
        }
        Long follow = data.getLong("follow");
        if (null != follow) {
            this.follow = follow;
        }
//		Long message = data.getLong("message");
//		if(null!=message){
//			this.message = message;
//		}
        Long inAppDetailUv = data.getLong("in_app_detail_uv");
        if (null != inAppDetailUv) {
            this.inAppDetailUv = inAppDetailUv;
        }
        Long form = data.getLong("form");
        if (null != form) {
            this.form = form;
        }
//		BigDecimal convert_cost = data.getBigDecimal("convert_cost");
//		if(null!=convert_cost){
//			this.convertCost = convert_cost;
//		}
        Long comment = data.getLong("comment");
        if (null != comment) {
            this.comment = comment;
        }
        Long inAppUv = data.getLong("in_app_uv");
        if (null != inAppUv) {
            this.inAppUv = inAppUv;
        }
        Long register = data.getLong("register");
        if (null != register) {
            this.register = register;
        }
        Long campaignId = data.getLong("campaign_id");
        if (null != campaignId) {
            this.campaignId = campaignId;
        }
        String adName = data.getString("ad_name");
        if (null != adName) {
            this.adName = adName;
        }
        Long adId = data.getLong("ad_id");
        if (null != adId) {
            this.adId = adId;
        }

        this.id = "" + this.adId + this.statDatetime.substring(0, 10);
        this.createTime = new Date();
        this.updateTime = new Date();
    }

    public BytedancePlanDailyReport() {
    }
}
