package com.sundot.airport.ledger.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 员工画像聚合 VO
 */
public class EmployeePortraitVO {

    // ── 基本信息 ──────────────────────────────────────────────────────────────

    private Long userId;
    private String personName;
    private String avatar;
    private String sex;
    private String sexText;
    private String deptName;
    private String parentDeptName;
    private String deptPath;
    private String qualificationLevelText;
    private String schooling;
    private String politicalStatusText;
    private String characterCharacteristics;
    private String workingStyle;
    private String phonenumber;
    private String birthday;       // 出生日期，从身份证计算
    private String major;          // 专业（新增字段）
    private String nativePlace;    // 籍贯（新增字段）
    private String nation;         // 民族（新增字段）
    private String roleNames;      // 职务（来自 sys_role）
    private String postNames;      // 岗位（来自 sys_post）

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date startWorkingDate;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date securityCheckStartDate;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date entryDate;              // 入职时间（新增字段）

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date xrayOperatorStarttime;  // X射线操作员开始时间（新增字段）

    private Integer workYears;           // 工龄
    private Integer securityCheckYears;  // 安检年限
    private Integer xrayOperatorYears;   // 开机年限（新增字段）
    private Integer companyYears;        // 司龄（新增字段）
    private String securityInspectionPosition;

    // ── 综合得分 ──────────────────────────────────────────────────────────────

    private BigDecimal totalScore;

    // ── 六维度雷达 ────────────────────────────────────────────────────────────

    private List<DimScoreItem> dimensions;

    // ── 最新考试成绩 ──────────────────────────────────────────────────────────

    private BigDecimal theoryScore;
    private BigDecimal imageScore;
    private String examCategory;
    private String examPeriod;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date examDate;

    // ── 获奖/加分记录 ─────────────────────────────────────────────────────────

    private List<AwardRecord> awards;

    // ── 质控情况 ──────────────────────────────────────────────────────────────

    private Integer qualityControlCount;   // 查获违规品次数
    private Integer qualityControlEventCount; // 监察问题记录次数
    private Integer realtimeInterceptionCount; // 实时质控拦截次数
    private Integer level3QualityControlCount; // 三级质控巡查次数

    // ── 配分明细（加分+扣分全量） ──────────────────────────────────────────────

    private List<ScoreDetail> scoreDetails;

    // ── getter / setter ───────────────────────────────────────────────────────

    public Long getUserId() { return userId; }
    public void setUserId(Long userId) { this.userId = userId; }

    public String getPersonName() { return personName; }
    public void setPersonName(String personName) { this.personName = personName; }

    public String getAvatar() { return avatar; }
    public void setAvatar(String avatar) { this.avatar = avatar; }

    public String getSex() { return sex; }
    public void setSex(String sex) { this.sex = sex; }

    public String getSexText() { return sexText; }
    public void setSexText(String sexText) { this.sexText = sexText; }

    public String getDeptName() { return deptName; }
    public void setDeptName(String deptName) { this.deptName = deptName; }

    public String getParentDeptName() { return parentDeptName; }
    public void setParentDeptName(String parentDeptName) { this.parentDeptName = parentDeptName; }

    public String getDeptPath() { return deptPath; }
    public void setDeptPath(String deptPath) { this.deptPath = deptPath; }

    public String getQualificationLevelText() { return qualificationLevelText; }
    public void setQualificationLevelText(String qualificationLevelText) { this.qualificationLevelText = qualificationLevelText; }

    public String getSchooling() { return schooling; }
    public void setSchooling(String schooling) { this.schooling = schooling; }

    public String getPoliticalStatusText() { return politicalStatusText; }
    public void setPoliticalStatusText(String politicalStatusText) { this.politicalStatusText = politicalStatusText; }

    public String getCharacterCharacteristics() { return characterCharacteristics; }
    public void setCharacterCharacteristics(String characterCharacteristics) { this.characterCharacteristics = characterCharacteristics; }

    public String getWorkingStyle() { return workingStyle; }
    public void setWorkingStyle(String workingStyle) { this.workingStyle = workingStyle; }

    public String getPhonenumber() { return phonenumber; }
    public void setPhonenumber(String phonenumber) { this.phonenumber = phonenumber; }

    public String getBirthday() { return birthday; }
    public void setBirthday(String birthday) { this.birthday = birthday; }

    public String getMajor() { return major; }
    public void setMajor(String major) { this.major = major; }

    public String getNativePlace() { return nativePlace; }
    public void setNativePlace(String nativePlace) { this.nativePlace = nativePlace; }

    public String getNation() { return nation; }
    public void setNation(String nation) { this.nation = nation; }

    public String getRoleNames() { return roleNames; }
    public void setRoleNames(String roleNames) { this.roleNames = roleNames; }

    public String getPostNames() { return postNames; }
    public void setPostNames(String postNames) { this.postNames = postNames; }

    public Date getStartWorkingDate() { return startWorkingDate; }
    public void setStartWorkingDate(Date startWorkingDate) { this.startWorkingDate = startWorkingDate; }

    public Date getSecurityCheckStartDate() { return securityCheckStartDate; }
    public void setSecurityCheckStartDate(Date securityCheckStartDate) { this.securityCheckStartDate = securityCheckStartDate; }

    public Date getEntryDate() { return entryDate; }
    public void setEntryDate(Date entryDate) { this.entryDate = entryDate; }

    public Date getXrayOperatorStarttime() { return xrayOperatorStarttime; }
    public void setXrayOperatorStarttime(Date xrayOperatorStarttime) { this.xrayOperatorStarttime = xrayOperatorStarttime; }

    public Integer getWorkYears() { return workYears; }
    public void setWorkYears(Integer workYears) { this.workYears = workYears; }

    public Integer getSecurityCheckYears() { return securityCheckYears; }
    public void setSecurityCheckYears(Integer securityCheckYears) { this.securityCheckYears = securityCheckYears; }

    public Integer getXrayOperatorYears() { return xrayOperatorYears; }
    public void setXrayOperatorYears(Integer xrayOperatorYears) { this.xrayOperatorYears = xrayOperatorYears; }

    public Integer getCompanyYears() { return companyYears; }
    public void setCompanyYears(Integer companyYears) { this.companyYears = companyYears; }

    public String getSecurityInspectionPosition() { return securityInspectionPosition; }
    public void setSecurityInspectionPosition(String securityInspectionPosition) { this.securityInspectionPosition = securityInspectionPosition; }

    public BigDecimal getTotalScore() { return totalScore; }
    public void setTotalScore(BigDecimal totalScore) { this.totalScore = totalScore; }

    public List<DimScoreItem> getDimensions() { return dimensions; }
    public void setDimensions(List<DimScoreItem> dimensions) { this.dimensions = dimensions; }

    public BigDecimal getTheoryScore() { return theoryScore; }
    public void setTheoryScore(BigDecimal theoryScore) { this.theoryScore = theoryScore; }

    public BigDecimal getImageScore() { return imageScore; }
    public void setImageScore(BigDecimal imageScore) { this.imageScore = imageScore; }

    public String getExamCategory() { return examCategory; }
    public void setExamCategory(String examCategory) { this.examCategory = examCategory; }

    public String getExamPeriod() { return examPeriod; }
    public void setExamPeriod(String examPeriod) { this.examPeriod = examPeriod; }

    public Date getExamDate() { return examDate; }
    public void setExamDate(Date examDate) { this.examDate = examDate; }

    public List<AwardRecord> getAwards() { return awards; }
    public void setAwards(List<AwardRecord> awards) { this.awards = awards; }

    public Integer getQualityControlEventCount() {
        return qualityControlEventCount;
    }

    public void setQualityControlEventCount(Integer qualityControlEventCount) {
        this.qualityControlEventCount = qualityControlEventCount;
    }

    public Integer getRealtimeInterceptionCount() {
        return realtimeInterceptionCount;
    }

    public void setRealtimeInterceptionCount(Integer realtimeInterceptionCount) {
        this.realtimeInterceptionCount = realtimeInterceptionCount;
    }

    public Integer getLevel3QualityControlCount() {
        return level3QualityControlCount;
    }

    public void setLevel3QualityControlCount(Integer level3QualityControlCount) {
        this.level3QualityControlCount = level3QualityControlCount;
    }
// ── 内部类 ────────────────────────────────────────────────────────────────

    public static class DimScoreItem {
        private String name;
        private BigDecimal score;
        private BigDecimal weight;
        private BigDecimal baseScore;
        private BigDecimal eventScore;

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

        public BigDecimal getScore() { return score; }
        public void setScore(BigDecimal score) { this.score = score; }

        public BigDecimal getWeight() { return weight; }
        public void setWeight(BigDecimal weight) { this.weight = weight; }

        public BigDecimal getBaseScore() { return baseScore; }
        public void setBaseScore(BigDecimal baseScore) { this.baseScore = baseScore; }

        public BigDecimal getEventScore() { return eventScore; }
        public void setEventScore(BigDecimal eventScore) { this.eventScore = eventScore; }
    }

    public static class AwardRecord {
        private String level2Name;   // 二级指标
        private String level3Name;   // 三级指标
        private String level4Name;   // 四级指标
        private BigDecimal score;    // 获奖情况（分值）

        public String getLevel2Name() { return level2Name; }
        public void setLevel2Name(String level2Name) { this.level2Name = level2Name; }

        public String getLevel3Name() { return level3Name; }
        public void setLevel3Name(String level3Name) { this.level3Name = level3Name; }

        public String getLevel4Name() { return level4Name; }
        public void setLevel4Name(String level4Name) { this.level4Name = level4Name; }

        public BigDecimal getScore() { return score; }
        public void setScore(BigDecimal score) { this.score = score; }
    }

    public Integer getQualityControlCount() { return qualityControlCount; }
    public void setQualityControlCount(Integer qualityControlCount) { this.qualityControlCount = qualityControlCount; }

    public List<ScoreDetail> getScoreDetails() { return scoreDetails; }
    public void setScoreDetails(List<ScoreDetail> scoreDetails) { this.scoreDetails = scoreDetails; }

    public static class ScoreDetail {
        private String dimensionName;
        private String level2Name;
        private String level3Name;
        private BigDecimal totalScore;

        public String getDimensionName() { return dimensionName; }
        public void setDimensionName(String dimensionName) { this.dimensionName = dimensionName; }

        public String getLevel2Name() { return level2Name; }
        public void setLevel2Name(String level2Name) { this.level2Name = level2Name; }

        public String getLevel3Name() { return level3Name; }
        public void setLevel3Name(String level3Name) { this.level3Name = level3Name; }

        public BigDecimal getTotalScore() { return totalScore; }
        public void setTotalScore(BigDecimal totalScore) { this.totalScore = totalScore; }
    }
}
