package cn.iocoder.yudao.module.system.controller.admin.biz.vo;

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

import java.util.List;

/**
 * 楼栋楼层统计信息 Response VO
 *
 * @author 系统管理员
 */
@Schema(description = "管理后台 - 楼栋楼层统计信息 Response VO")
@Data
public class BuildFloorStatisticsRespVO {

    @Schema(description = "楼栋列表")
    private List<BuildStatisticsVO> buildList;

    @Schema(description = "员工在职统计")
    private StaffJobStatsVO staffStats;

    @Schema(description = "楼栋统计信息")
    @Data
    public static class BuildStatisticsVO {
        @Schema(description = "楼栋ID")
        private Long buildId;

        @Schema(description = "楼栋名称")
        private String buildName;

        @Schema(description = "楼层统计列表")
        private List<FloorStatisticsVO> floorList;
    }

    @Schema(description = "楼层统计信息")
    @Data
    public static class FloorStatisticsVO {
        @Schema(description = "楼层ID")
        private Long floorId;

        @Schema(description = "楼层名称")
        private String floorName;

        @Schema(description = "楼层编号（用于排序）")
        private Integer floorNumber;

        @Schema(description = "是否为小计行")
        private Boolean isSubtotal;

        // ========== 总床位信息 ==========
        @Schema(description = "设计床位数")
        private Integer designedBedCount;

        @Schema(description = "床位类型（认知症/护理型）")
        private String bedType;

        @Schema(description = "一期床位数")
        private Integer phase1BedCount;

        @Schema(description = "二期床位数")
        private Integer phase2BedCount;

        @Schema(description = "三期床位数")
        private Integer phase3BedCount;

        @Schema(description = "在住人数")
        private Integer residentCount;

        // ========== 长者类型（按房间类型和等级） ==========
        @Schema(description = "房间类型统计列表，动态根据房间床位数生成（如：2人间、4人间、6人间等）")
        private List<RoomTypeStatisticsItem> roomTypeStatistics;

        // ========== 长者类型总人数（按等级汇总） ==========
        @Schema(description = "一级人数")
        private Integer level1Count;

        @Schema(description = "二级人数")
        private Integer level2Count;

        @Schema(description = "三级人数")
        private Integer level3Count;

        @Schema(description = "四级人数")
        private Integer level4Count;
    }

    @Schema(description = "房间类型统计信息")
    @Data
    public static class RoomTypeStatistics {
        @Schema(description = "一级人数")
        private Integer level1Count;

        @Schema(description = "二级人数")
        private Integer level2Count;

        @Schema(description = "三级人数")
        private Integer level3Count;

        @Schema(description = "四级人数")
        private Integer level4Count;
    }

    @Schema(description = "房间类型统计项（包含房间类型名称和统计信息）")
    @Data
    public static class RoomTypeStatisticsItem {
        @Schema(description = "房间类型名称（如：2人间、4人间、6人间等）")
        private String roomType;

        @Schema(description = "一级人数")
        private Integer level1Count;

        @Schema(description = "二级人数")
        private Integer level2Count;

        @Schema(description = "三级人数")
        private Integer level3Count;

        @Schema(description = "四级人数")
        private Integer level4Count;
    }

    @Schema(description = "员工在职统计对象")
    @Data
    public static class StaffJobStatsVO {
        @Schema(description = "编制人数")
        private Integer staffingCount;

        @Schema(description = "在岗人数")
        private Integer onDutyCount;

        @Schema(description = "试用期人数")
        private Integer probationCount;

        @Schema(description = "转正人数")
        private Integer regularizedCount;

        @Schema(description = "缺岗人数")
        private Integer vacantCount;
    }
}

