package com.gci.boot.modules.statis.vo;

import java.util.Date;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gci.boot.common.dict.annotation.Dict;
import com.gci.boot.constant.CommonConstant;

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

/**
 * 
 */
@Data
@ColumnWidth(20)
public class InsuranceStatisVo {

	@ExcelIgnore
    private String projectId;
    
    @ExcelProperty(value = "所属项目", index = 0)
    private String projectName;
    
    @ExcelProperty(value = "统计期间", index = 1)
    private String statisTime;

    @ExcelProperty(value = "车辆型号", index = 2)
    @Dict(dicCode = "vehicle_type")
    private String vehicleType;

    @ApiModelProperty("车牌号")
    @ExcelIgnore
    private String plateNumber;
    
    @ExcelProperty(value = "保险车次", index = 3)
    private Integer vehicleCount = 0;
    
    @ExcelProperty(value = "保险金额（元）", index = 4)
    private Double totalPrice = 0d;
    
    @ExcelProperty(value = "平均金额（元/车）", index = 5)
    private Double avgPrice = 0d;
    
    public Double getAvgPrice() {
    	return CommonConstant.formatDouble((this.totalPrice/this.vehicleCount));
    }
    
    //统计类型 1按日，2按月，3按年
    @ExcelIgnore
    private String type;

    @ApiModelProperty("日期开始")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd")
    @ExcelIgnore
    private Date createDateStart;

    @ApiModelProperty("日期结束")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd")
    @ExcelIgnore
    private Date createDateEnd;
    
}
