package com.ylcm.sys.excel.model;

import java.io.Serializable;
import java.math.BigDecimal;

import org.springframework.beans.BeanUtils;

import com.alibaba.excel.annotation.ExcelProperty;
import com.ylcm.sys.enums.AdSpecialShowEnvEnum;
import com.ylcm.sys.excel.converter.FloatConverter;
import com.ylcm.sys.vo.AdSpecialAnalysisVO;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 *    专题广告数据分析列表导出
 */
@Data
public class SpecialAnalysisExportDTO implements Serializable{

	
	private static final long serialVersionUID = 3863153959765813542L;

    @ApiModelProperty(value = "媒体名称")
    @ExcelProperty(index = 0, value="媒体名称")
    private String mediaName;
    
    @ApiModelProperty(value = "播出时间")
    @ExcelProperty(index = 1, value="播出时间")
    private String showTime;
    
    @ApiModelProperty(value = "播出日期")
    @ExcelProperty(index = 2, value="播出日期")
    private String showDate;
    
    @ApiModelProperty(value = "播出环境")
    @ExcelProperty(index = 3, value="播出环境")
    private String showEnvMsg;

    @ApiModelProperty(value = "节目名称")
    @ExcelProperty(index = 4, value="节目名称")
    private String tvName;
    
    @ApiModelProperty(value = "时长(秒)")
    @ExcelProperty(index = 5, converter = FloatConverter.class, value="时长(秒)")
    private Float showDuration;
    
    @ApiModelProperty(value = "产品名称")
    @ExcelProperty(index = 6, value="产品名称")
    private String productName;
    
    @ApiModelProperty(value = "品牌")
    @ExcelProperty(index = 7, value="品牌")
    private String brandName;
    
    @ApiModelProperty(value = "一级行业")
    @ExcelProperty(index = 8, value="一级行业")
    private String firstInd;
    
    @ApiModelProperty(value = "二级行业")
    @ExcelProperty(index = 9, value="二级行业")
    private String secondInd;
    
    @ApiModelProperty(value = "广告主")
    @ExcelProperty(index = 10, value="广告主")
    private String advMaster;
    
    @ApiModelProperty(value = "联系方式")
    @ExcelProperty(index = 11, value="联系方式")
    private String phone;
    
    @ApiModelProperty(value = "价格(万)")
    @ExcelProperty(index = 12, value="价格(万)")
    private BigDecimal price;
    
    @Data
	public static class SpecialAnalysisExportDTOBuilder{
		private AdSpecialAnalysisVO adSpecialAnalysisVO;	
		
		public SpecialAnalysisExportDTO build(){
			SpecialAnalysisExportDTO eo = new SpecialAnalysisExportDTO();
            /*数据复制*/
		    BeanUtils.copyProperties(adSpecialAnalysisVO, eo);
		    eo.setShowEnvMsg(AdSpecialShowEnvEnum.getMsgByVal(adSpecialAnalysisVO.getShowEnv()));
			return eo;
		}
		
		public SpecialAnalysisExportDTOBuilder adSpecialAnalysisVO(AdSpecialAnalysisVO adSpecialAnalysisVO){
			this.adSpecialAnalysisVO = adSpecialAnalysisVO;
			return this;
		}
	}
    
}
