/*
 * @Author: Kane
 * @Date: 2023-06-06 17:35:54
 * @LastEditors: Kane
 * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/archievement/caller/CallerArchievementQueryResponse.java
 * @Description: 
 * 
 * Copyright (c) ${2022} by Kane, All Rights Reserved. 
 */
package com.cpic.xim.web.controllers.archievement.caller;

import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
import com.cpic.xim.web.controllers.QueryResponse;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;

public class CallerArchievementQueryResponse extends QueryResponse
{
    @JsonProperty("callerCode")
    String callerCode;

    @JsonProperty("callerName")
    String callerName;

    @JsonProperty( "total_archievement" )
    private long totalArchievement; // 总业绩

    @JsonProperty( "motoPremiumPresentMonth" )
    private double motoPremiumPresentMonth; // 当月车险保费

    // 每月业绩列表
    // 要保证数据是按照月份排序。
    @JsonProperty( "mensual_archievement_list" )
    private ArrayList<MensualArchievementItem> mensualArchievementList;

    @JsonProperty( "insurance_renewal_rate" )
    private String insuranceRenewalRate; // 续保率

    @JsonProperty( "attaching_rate" )
    private String attachingRate; // 车非渗透率

    public CallerArchievementQueryResponse( boolean success, String message, String callerCode,
            String callerName, long totalArchievement, double motoPremiumPresentMonth,
            ArrayList<MensualArchievementItem> mensualArchievementList, String insuranceRenewalRate,
            String attachingRate )
    {
        super( success, message );
        this.callerCode = callerCode;
        this.callerName = callerName;
        this.totalArchievement = totalArchievement;
        this.motoPremiumPresentMonth = motoPremiumPresentMonth;
        this.mensualArchievementList = mensualArchievementList;
        this.insuranceRenewalRate = insuranceRenewalRate;
        this.attachingRate = attachingRate;
    }

    public CallerArchievementQueryResponse( String callerCode, String callerName,
            long totalArchievement, double motoPremiumPresentMonth,
            ArrayList<MensualArchievementItem> mensualArchievementList, String insuranceRenewalRate,
            String attachingRate )
    {
        this.callerCode = callerCode;
        this.callerName = callerName;
        this.totalArchievement = totalArchievement;
        this.motoPremiumPresentMonth = motoPremiumPresentMonth;
        this.mensualArchievementList = mensualArchievementList;
        this.insuranceRenewalRate = insuranceRenewalRate;
        this.attachingRate = attachingRate;
    }

    @Override
    public String toString()
    {
        return "CallerArchievementQueryResponse [callerCode=" + callerCode + ", callerName="
                + callerName + ", totalArchievement=" + totalArchievement
                + ", motoPremiumPresentMonth=" + motoPremiumPresentMonth
                + ", mensualArchievementList=" + mensualArchievementList + ", insuranceRenewalRate="
                + insuranceRenewalRate + ", attachingRate=" + attachingRate + "]";
    }

    @Override
    public int hashCode()
    {
        final int prime = 31;
        int result = super.hashCode();
        result = prime * result + ((callerCode == null) ? 0 : callerCode.hashCode());
        result = prime * result + ((callerName == null) ? 0 : callerName.hashCode());
        result = prime * result + (int) (totalArchievement ^ (totalArchievement >>> 32));
        long temp;
        temp = Double.doubleToLongBits( motoPremiumPresentMonth );
        result = prime * result + (int) (temp ^ (temp >>> 32));
        result = prime * result
                + ((mensualArchievementList == null) ? 0 : mensualArchievementList.hashCode());
        result = prime * result
                + ((insuranceRenewalRate == null) ? 0 : insuranceRenewalRate.hashCode());
        result = prime * result + ((attachingRate == null) ? 0 : attachingRate.hashCode());
        return result;
    }

    public void setMotoPremiumPresentMonth( double motoPremiumPresentMonth )
    {
        this.motoPremiumPresentMonth = motoPremiumPresentMonth;
    }

    @Override
    public boolean equals( Object obj )
    {
        if ( this == obj )
            return true;
        if ( !super.equals( obj ) )
            return false;
        if ( getClass() != obj.getClass() )
            return false;
        CallerArchievementQueryResponse other = (CallerArchievementQueryResponse) obj;
        if ( callerCode == null )
        {
            if ( other.callerCode != null )
                return false;
        }
        else if ( !callerCode.equals( other.callerCode ) )
            return false;
        if ( callerName == null )
        {
            if ( other.callerName != null )
                return false;
        }
        else if ( !callerName.equals( other.callerName ) )
            return false;
        if ( totalArchievement != other.totalArchievement )
            return false;
        if ( Double.doubleToLongBits( motoPremiumPresentMonth ) != Double
                .doubleToLongBits( other.motoPremiumPresentMonth ) )
            return false;
        if ( mensualArchievementList == null )
        {
            if ( other.mensualArchievementList != null )
                return false;
        }
        else if ( !mensualArchievementList.equals( other.mensualArchievementList ) )
            return false;
        if ( insuranceRenewalRate == null )
        {
            if ( other.insuranceRenewalRate != null )
                return false;
        }
        else if ( !insuranceRenewalRate.equals( other.insuranceRenewalRate ) )
            return false;
        if ( attachingRate == null )
        {
            if ( other.attachingRate != null )
                return false;
        }
        else if ( !attachingRate.equals( other.attachingRate ) )
            return false;
        return true;
    }

    public String getCallerCode()
    {
        return callerCode;
    }

    public void setCallerCode( String callerCode )
    {
        this.callerCode = callerCode;
    }

    public String getCallerName()
    {
        return callerName;
    }

    public void setCallerName( String callerName )
    {
        this.callerName = callerName;
    }

    public long getTotalArchievement()
    {
        return totalArchievement;
    }

    public void setTotalArchievement( long totalArchievement )
    {
        this.totalArchievement = totalArchievement;
    }

    public ArrayList<MensualArchievementItem> getMensualArchievementList()
    {
        return mensualArchievementList;
    }

    public void setMensualArchievementList( ArrayList<MensualArchievementItem> mensualArchievementList )
    {
        this.mensualArchievementList = mensualArchievementList;
    }

    public String getInsuranceRenewalRate()
    {
        return insuranceRenewalRate;
    }

    public void setInsuranceRenewalRate( String insuranceRenewalRate )
    {
        this.insuranceRenewalRate = insuranceRenewalRate;
    }

    public String getAttachingRate()
    {
        return attachingRate;
    }

    public void setAttachingRate( String attachingRate )
    {
        this.attachingRate = attachingRate;
    }

    public double getMotoPremiumPresentMonth()
    {
        return motoPremiumPresentMonth;
    }
}
