package cn.iocoder.lyzsys.module.tjt.controller.admin.report.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

@Schema(description = "管理后台 - 项目总览表预览 Response VO")
@Data
public class ProjectOverviewPreviewRespVO {

    @Schema(description = "年度", example = "2026")
    private Integer year;

    @Schema(description = "专业所名称", example = "给排水所")
    private String officeName;

    @Schema(description = "员工动态列")
    private List<EmployeeColumn> employeeColumns = Collections.emptyList();

    @Schema(description = "项目行")
    private List<ProjectRow> rows = Collections.emptyList();

    @Schema(description = "合计行")
    private ProjectRow totalRow;

    @Schema(description = "员工动态列")
    @Data
    public static class EmployeeColumn {

        @Schema(description = "员工 ID", example = "1")
        private Long employeeId;

        @Schema(description = "员工姓名", example = "张三")
        private String employeeName;

    }

    @Schema(description = "项目总览行")
    @Data
    public static class ProjectRow {

        @Schema(description = "序号", example = "1")
        private Integer serialNo;

        @Schema(description = "是否合计行", example = "false")
        private Boolean totalRow = false;

        @Schema(description = "项目名称")
        private String projectName;

        @Schema(description = "工程进度情况及其它说明")
        private String progressText;

        @Schema(description = "工作阶段")
        private String workStage;

        @Schema(description = "本专业 + 项目总核算总产值，单位：万元")
        private BigDecimal totalOutputAmountWan;

        @Schema(description = "往期已发放比例，小数值，例如 0.2 表示 20%")
        private BigDecimal historicalIssuedRatio;

        @Schema(description = "本期结算占比，小数值，例如 0.2 表示 20%")
        private BigDecimal currentSettlementRatio;

        @Schema(description = "本期结算考核产值，单位：万元")
        private BigDecimal currentSettlementAmountWan;

        @Schema(description = "未结算比例，小数值，例如 0.2 表示 20%")
        private BigDecimal pendingRatio;

        @Schema(description = "员工季度金额，key 为员工 ID，金额单位：万元")
        private Map<Long, EmployeeAmountValue> employeeAmountMap = new LinkedHashMap<>();

    }

    @Schema(description = "员工季度金额")
    @Data
    public static class EmployeeAmountValue {

        @Schema(description = "一季度，单位：万元")
        private BigDecimal quarterOneAmountWan;

        @Schema(description = "二季度，单位：万元")
        private BigDecimal quarterTwoAmountWan;

        @Schema(description = "三季度，单位：万元")
        private BigDecimal quarterThreeAmountWan;

        @Schema(description = "四季度，单位：万元")
        private BigDecimal quarterFourAmountWan;

        @Schema(description = "本年度小计，单位：万元")
        private BigDecimal annualTotalAmountWan;

    }

}
