package com.mortals.xhx.module.perform.model;
import java.math.BigDecimal;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.perform.model.vo.PerformRulesVo;
import lombok.Data;
/**
 * 绩效规则信息实体对象
 *
 * @author zxfei
 * @date 2023-07-10
 */
@Data
public class PerformRulesEntity extends PerformRulesVo {
    private static final long serialVersionUID = 1L;

    /**
     * 分类id
     */
    private Long categoryId;
    /**
     * 分类名称
     */
    private String categoryName;
    /**
     * 考核内容简称
     */
    private String name;
    /**
     * 评分标准
     */
    private String content;
    /**
     * 增减类型(1.增加,2.扣除)
     */
    private Integer subAddType;
    /**
     * 扣分或增加分值
     */
    private BigDecimal score;
    /**
     * 是否关联负责人(0.否,1.是)
     */
    private Integer assoOwner;
    /**
     * 负责人扣分或增加分值
     */
    private BigDecimal ownerScore;
    /**
     * 备注
     */
    private String remark;
    /**
     * 规则类型(1.考勤绩效,2.评价绩效指标,3.办件绩效指标,4.效能绩效指标,5.其它绩效指标)
     */
    private Integer type;
    /**
     * 规则编码，唯一,默认规则类型内容简称拼音首字母。
     */
    private String ruleCode;
    @Override
    public int hashCode() {
        return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof PerformRulesEntity) {
            PerformRulesEntity tmp = (PerformRulesEntity) obj;
            if (this.getId() == tmp.getId()) {
                return true;
            }
        }
        return false;
    }

    public void initAttrValue(){

        this.categoryId = -1L;

        this.categoryName = "";

        this.name = "";

        this.content = "";

        this.subAddType = 1;

        this.score = BigDecimal.valueOf(0.00);

        this.assoOwner = 0;

        this.ownerScore = BigDecimal.valueOf(0.00);

        this.remark = "";

        this.type = 1;

        this.ruleCode = "";
    }
}