package com.qmth.sop.business.bean.report;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.sop.common.enums.QualityProblemReasonEnum;
import io.swagger.annotations.ApiModelProperty;

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

/**
 * @Description: 质量监控分析报表bean
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2024/9/18
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class QualityAnalyseReportBean implements Serializable {

    @ApiModelProperty(value = "大区经理id")
    @JsonSerialize(using = ToStringSerializer.class)
    Long areaManagerId;

    @ApiModelProperty(value = "机构id")
    @JsonSerialize(using = ToStringSerializer.class)
    Long supplierId;

    @ApiModelProperty(value = "名称")
    String name;

    @ApiModelProperty(value = "质量问题总数")
    Integer sum;

    @ApiModelProperty(value = "影响度A标题")
    String influenceDegreeATitle = "A类";

    @ApiModelProperty(value = "影响度A")
    Integer influenceDegreeA;

    @ApiModelProperty(value = "影响度A比率")
    BigDecimal influenceDegreeARate;

    @ApiModelProperty(value = "影响度B标题")
    String influenceDegreeBTitle = "B类";

    @ApiModelProperty(value = "影响度B")
    Integer influenceDegreeB;

    @ApiModelProperty(value = "影响度B比率")
    BigDecimal influenceDegreeBRate;

    @ApiModelProperty(value = "影响度C标题")
    String influenceDegreeCTitle = "C类";

    @ApiModelProperty(value = "影响度C")
    Integer influenceDegreeC;

    @ApiModelProperty(value = "影响度C比率")
    BigDecimal influenceDegreeCRate;

    @ApiModelProperty(value = "影响度D标题")
    String influenceDegreeDTitle = "D类";

    @ApiModelProperty(value = "影响度D")
    Integer influenceDegreeD;

    @ApiModelProperty(value = "影响度D比率")
    BigDecimal influenceDegreeDRate;

    @ApiModelProperty(value = "问题原因")
    QualityProblemReasonEnum reason;

    @ApiModelProperty(value = "问题原因总数")
    Integer reasonSum;

    @ApiModelProperty(value = "问题原因比率")
    BigDecimal reasonRate;

    public QualityAnalyseReportBean() {

    }

    public QualityAnalyseReportBean(QualityProblemReasonEnum qualityProblemReasonEnum) {
        this.setNull();
        this.setReason(qualityProblemReasonEnum);
        this.setName(this.getReason().getTitle());
        this.setReasonSum(0);
        this.setReasonRate(new BigDecimal(0));
    }

    public void setNull() {
        this.setInfluenceDegreeATitle(null);
        this.setInfluenceDegreeBTitle(null);
        this.setInfluenceDegreeCTitle(null);
        this.setInfluenceDegreeDTitle(null);
    }

    public Long getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Long supplierId) {
        this.supplierId = supplierId;
    }

    public Long getAreaManagerId() {
        return areaManagerId;
    }

    public void setAreaManagerId(Long areaManagerId) {
        this.areaManagerId = areaManagerId;
    }

    public String getInfluenceDegreeATitle() {
        return influenceDegreeATitle;
    }

    public void setInfluenceDegreeATitle(String influenceDegreeATitle) {
        this.influenceDegreeATitle = influenceDegreeATitle;
    }

    public String getInfluenceDegreeBTitle() {
        return influenceDegreeBTitle;
    }

    public void setInfluenceDegreeBTitle(String influenceDegreeBTitle) {
        this.influenceDegreeBTitle = influenceDegreeBTitle;
    }

    public String getInfluenceDegreeCTitle() {
        return influenceDegreeCTitle;
    }

    public void setInfluenceDegreeCTitle(String influenceDegreeCTitle) {
        this.influenceDegreeCTitle = influenceDegreeCTitle;
    }

    public String getInfluenceDegreeDTitle() {
        return influenceDegreeDTitle;
    }

    public void setInfluenceDegreeDTitle(String influenceDegreeDTitle) {
        this.influenceDegreeDTitle = influenceDegreeDTitle;
    }

    public String getName() {
        return Objects.nonNull(reason) ? reason.getTitle() : name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSum() {
        return sum;
    }

    public void setSum(Integer sum) {
        this.sum = sum;
    }

    public BigDecimal getInfluenceDegreeARate() {
        return influenceDegreeARate;
    }

    public void setInfluenceDegreeARate(BigDecimal influenceDegreeARate) {
        this.influenceDegreeARate = influenceDegreeARate;
    }

    public BigDecimal getInfluenceDegreeBRate() {
        return influenceDegreeBRate;
    }

    public void setInfluenceDegreeBRate(BigDecimal influenceDegreeBRate) {
        this.influenceDegreeBRate = influenceDegreeBRate;
    }

    public BigDecimal getInfluenceDegreeCRate() {
        return influenceDegreeCRate;
    }

    public void setInfluenceDegreeCRate(BigDecimal influenceDegreeCRate) {
        this.influenceDegreeCRate = influenceDegreeCRate;
    }

    public BigDecimal getInfluenceDegreeDRate() {
        return influenceDegreeDRate;
    }

    public void setInfluenceDegreeDRate(BigDecimal influenceDegreeDRate) {
        this.influenceDegreeDRate = influenceDegreeDRate;
    }

    public QualityProblemReasonEnum getReason() {
        return reason;
    }

    public void setReason(QualityProblemReasonEnum reason) {
        this.reason = reason;
    }

    public Integer getReasonSum() {
        return reasonSum;
    }

    public void setReasonSum(Integer reasonSum) {
        this.reasonSum = reasonSum;
    }

    public BigDecimal getReasonRate() {
        return reasonRate;
    }

    public void setReasonRate(BigDecimal reasonRate) {
        this.reasonRate = reasonRate;
    }

    public Integer getInfluenceDegreeA() {
        return influenceDegreeA;
    }

    public void setInfluenceDegreeA(Integer influenceDegreeA) {
        this.influenceDegreeA = influenceDegreeA;
    }

    public Integer getInfluenceDegreeB() {
        return influenceDegreeB;
    }

    public void setInfluenceDegreeB(Integer influenceDegreeB) {
        this.influenceDegreeB = influenceDegreeB;
    }

    public Integer getInfluenceDegreeC() {
        return influenceDegreeC;
    }

    public void setInfluenceDegreeC(Integer influenceDegreeC) {
        this.influenceDegreeC = influenceDegreeC;
    }

    public Integer getInfluenceDegreeD() {
        return influenceDegreeD;
    }

    public void setInfluenceDegreeD(Integer influenceDegreeD) {
        this.influenceDegreeD = influenceDegreeD;
    }
}
