package com.casic.missiles.dto.business.board;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.alibaba.excel.enums.poi.BorderStyleEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Objects;

/**
 * @Description:
 * @Author: wangpeng
 * @Date: 2023/4/11 15:25
 */
@ColumnWidth(30)
@HeadRowHeight(15)
@ContentRowHeight(20)
@ContentStyle(borderLeft = BorderStyleEnum.THIN, borderBottom = BorderStyleEnum.THIN, borderTop = BorderStyleEnum.THIN, borderRight = BorderStyleEnum.THIN)
@ExcelIgnoreUnannotated
@ApiModel
@Data
public class BoardDeptOutputResponse extends BoardBaseResponse {
    @ApiModelProperty(value = "产值总计(单位分)", dataType = "Integer")
    private Integer outPut;

    @ExcelProperty(value = "产值总计(元)", order = 10)
    private String outPutYuan;

    public String getOutPutYuan() {
        if(Objects.nonNull(outPut)) {
            outPutYuan = BigDecimal.valueOf(outPut).divide(BigDecimal.valueOf(100), 2, BigDecimal.ROUND_HALF_UP).toPlainString();
        }
        return outPutYuan;
    }

    //合同实际收款金额，计算产值统计使用
    @ApiModelProperty(hidden = true)
    private Integer actualAmount = 0;

    //合同总样品数，计算产值统计使用
    @ApiModelProperty(hidden = true)
    private Integer samplesTotal = 0;

    //个人对该样品出具证书的总权重，计算产值统计使用
    @ApiModelProperty(hidden = true)
    private Integer personalCertificatesTotal = 0;

    //该样品出具所有证书的总权重，计算产值统计使用
    @ApiModelProperty(hidden = true)
    private Integer certificatesTotal = 0;
}
