package com.mortals.xhx.module.perform.model;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;

import cn.hutool.core.date.DateUtil;
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.PerformPerposeDeptStatVo;
import lombok.Data;
/**
 * 部门目标统计实体对象
 *
 * @author zxfei
 * @date 2023-07-12
 */
@Data
public class PerformPerposeDeptStatEntity extends PerformPerposeDeptStatVo {
    private static final long serialVersionUID = 1L;

    /**
     * 部门id号
     */
    private Long deptId;
    /**
     * 部门名称
     */
    private String deptName;
    /**
     * 旷工率
     */
    private BigDecimal absentRate;
    /**
     * 缺卡率
     */
    private BigDecimal absenceRate;
    /**
     * 迟到率
     */
    private BigDecimal lateRate;
    /**
     * 早退率
     */
    private BigDecimal earlyRate;
    /**
     * 请假率
     */
    private BigDecimal leaveRate;
    /**
     * 离岗率
     */
    private BigDecimal turnoverRate;
    /**
     * 睡觉率
     */
    private BigDecimal sleepRate;
    /**
     * 玩手机率
     */
    private BigDecimal playPhoneRate;
    /**
     * 办件超期率
     */
    private BigDecimal expireWorkRate;
    /**
     * 差评率
     */
    private BigDecimal negaReviewRate;
    /**
     * 备注
     */
    private String remark;
    /**
     * 年
     */
    private Integer year;
    /**
     * 月
     */
    private Integer month;
    /**
     * 日
     */
    private Integer day;
    @Override
    public int hashCode() {
        return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof PerformPerposeDeptStatEntity) {
            PerformPerposeDeptStatEntity tmp = (PerformPerposeDeptStatEntity) obj;
            if (this.getId() == tmp.getId()) {
                return true;
            }
        }
        return false;
    }

    public void initAttrValue(){

        this.deptId = 0L;

        this.deptName = "";

        this.absentRate = BigDecimal.valueOf(0.00);

        this.absenceRate = BigDecimal.valueOf(0.00);

        this.lateRate = BigDecimal.valueOf(0.00);

        this.earlyRate = BigDecimal.valueOf(0.00);

        this.leaveRate = BigDecimal.valueOf(0.00);

        this.turnoverRate = BigDecimal.valueOf(0.00);

        this.sleepRate = BigDecimal.valueOf(0.00);

        this.playPhoneRate = BigDecimal.valueOf(0.00);

        this.expireWorkRate = BigDecimal.valueOf(0.00);

        this.negaReviewRate = BigDecimal.valueOf(0.00);

        this.remark = "";

        this.year = DateUtil.year(new Date());

        this.month = DateUtil.month(new Date())+1;

        this.day = DateUtil.dayOfMonth(new Date());
    }
}