package com.hz.pm.api.dashboard.model.vo;

import com.hz.pm.api.dashboard.model.entity.CockpitApplication;
import com.hz.pm.api.portrait.model.entity.Tag;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Data
@ApiModel(value = "驾驶舱统计数据对象VO", description = "")
public class CockpitStatsVO implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    private Long id;

    @ApiModelProperty("区域code")
    private String regionCode;

    @ApiModelProperty("区域名")
    private String regionName;

    @ApiModelProperty("年份")
    private Integer year;

    @ApiModelProperty("年份")
    private LocalDateTime createOn;

    @ApiModelProperty("项目监测数据")
    private Monitor monitorData;

    @ApiModelProperty("项目专家数据")
    private Expert expertData;

    @ApiModelProperty("顶部数据")
    private TopData topData;

    @ApiModelProperty("地图-项目数")
    private List<MapProjectsData> mapProjectData;

    @ApiModelProperty("状态-项目数")
    private StatusProjectsData statusProjectsData;

    @ApiModelProperty("优秀项目数据")
    private ExcellentData excellentData;

    @ApiModelProperty("核减数据")
    private ReduceData reduceData;

    @ApiModelProperty("产出数据")
    private ProduceData produceData;

    @ApiModelProperty("绩效数据")
    private PerformanceData performanceData;

    @ApiModelProperty("最佳应用or重大应用")
    private Map<String,List<CockpitApplication>> appDatas;

    @ApiModelProperty("数据质量区域信息")
    private List<QualityData> qualityDatas;

    @Data
    public static class Monitor {
        @ApiModelProperty("项目监控-超期建设项目数")
        private Integer monitorOverdueConstructionProjectsNum;

        @ApiModelProperty("项目监控-超期建设项目-增长比例")
        private String monitorOverdueConstructionProjectsRise;

        @ApiModelProperty("项目监控-环节滞后项目数")
        private Integer monitorLaggingProjectsNum;

        @ApiModelProperty("项目监控-环节滞后项目-增长比例")
        private String monitorLaggingProjectsRise;

        @ApiModelProperty("项目监控-预审驳回项目数")
        private Integer monitorRejectedPreReviewProjectsNum;

        @ApiModelProperty("项目监控-预审驳回项目-增长比例")
        private String monitorRejectedPreReviewProjectsRise;

        @ApiModelProperty("项目监控-评审驳回项目数")
        private Integer monitorRejectedApproveProjectsNum;

        @ApiModelProperty("项目监控-评审驳回项目-增长比例")
        private String monitorRejectedApproveProjectsRise;

        @ApiModelProperty("项目监控-验收条件未达标")
        private Integer monitorAcceptConditionsNotStandardsNum;

        @ApiModelProperty("项目监控-验收条件未达标-增长比例")
        private String monitorAcceptConditionsNotStandardsRise;

        @ApiModelProperty("项目监控-安全投入占比 图")
        private List<SafetyInput> monitorSafetyInputRate;

        @ApiModelProperty("项目监控-等保等级图")
        private List<SecrecyGradeChart> secrecyGradeCharts;

        @ApiModelProperty("项目监控-密保等级图")
        private List<PasswordGradeChart> passwordGradeCharts;
    }

    @Data
    public static class SecrecyGradeChart {
        public SecrecyGradeChart (Integer level,Integer num){
            this.level = level;
            this.num = num;
        }

        @ApiModelProperty("等保等级")
        private Integer level;

        @ApiModelProperty("等保数量")
        private Integer num;
    }

    @Data
    public static class PasswordGradeChart {
        public PasswordGradeChart (Integer level,Integer num){
            this.level = level;
            this.num = num;
        }

        @ApiModelProperty("密保等级")
        private Integer level;

        @ApiModelProperty("密保数量")
        private Integer num;
    }

    @Data
    public static class SafetyInput {
        private Integer year;
        private BigDecimal rate;
        private Integer amount;
    }

    @Data
    public static class Expert {
        @ApiModelProperty("专家-各区域专家数")
        private List<ExpertRegion> expertRegionData;

        @ApiModelProperty("专家-总人数")
        private Integer expertTotalNum;

        @ApiModelProperty("专家-总人数-包含这些标签的专家总人数")
        private Integer specialExpertNum;

        @ApiModelProperty("专家-方案合理性 数量")
        private Integer expertPlanRationalityNum;

        @ApiModelProperty("专家-计数可行性评估 数量")
        private Integer expertTechnicalFeasibilityAssessmentNum;

        @ApiModelProperty("专家-信创 数量")
        private Integer expertXinchuangNum;

        @ApiModelProperty("专家-软硬件核价 数量")
        private Integer expertSoftHardPricingNum;

        @ApiModelProperty("专家-党政信息 数量")
        private Integer expertPartyGovInfoNum;

        @ApiModelProperty("专家-网络安全 数量")
        private Integer expertNetworkSecurityNum;

        @ApiModelProperty("专家-信息化专家 数量")
        private Integer expertPromotionInfoTechnologyNum;

        @ApiModelProperty("专家-财务专家 数量")
        private Integer expertFinancialNum;

        @ApiModelProperty("专家-信创专家 数量")
        private Integer expertXinchuangOtherNum;
    }

    @Data
    public static class ExpertRegion {
        @ApiModelProperty("区域CODE")
        private String regionCode;

        @ApiModelProperty("区域名字")
        private String regionName;

        @ApiModelProperty("专家数量")
        private Integer expertNum;
    }

    @Data
    public static class TopData {
        @ApiModelProperty("顶部-计划项目数")
        private Integer topPlanProjectsNum;

        @ApiModelProperty("顶部-批复项目数")
        private Integer topApprovalProjectsNum;

        @ApiModelProperty("顶部-批复金额")
        private BigDecimal topApprovalProjectsAmount;

        @ApiModelProperty("顶部-平均建设周期")
        private Integer topAverageConstructionPeriod;

        @ApiModelProperty("顶部-在建项目数")
        private Integer topOngoingProjectsNum;
    }

    @Data
    public static class MapProjectsData {
        @ApiModelProperty("区域CODE")
        private String regionCode;

        @ApiModelProperty("区域名字")
        private String regionName;

        @ApiModelProperty("项目数量")
        private Integer projectsNum;
    }

    @Data
    public static class QualityData {
        @ApiModelProperty("区域CODE")
        private String regionCode;

        @ApiModelProperty("区域名字")
        private String regionName;

        @ApiModelProperty("质量分数")
        private BigDecimal quality = BigDecimal.ZERO;
    }

    @Data
    public static class StatusProjectsData {
        @ApiModelProperty("项目总数-计划状态")
        private Integer projectsTotalPlan;

        @ApiModelProperty("项目总数-申报状态")
        private Integer projectsTotalApply;

        @ApiModelProperty("项目总数-审批状态")
        private Integer projectsTotalApprove;

        @ApiModelProperty("项目总数-建设状态")
        private Integer projectsTotalConstruction;

        @ApiModelProperty("项目总数-验收状态")
        private Integer projectsTotalAccept;

        @ApiModelProperty("项目总数-运维状态")
        private Integer projectsTotalOperation;

        @ApiModelProperty("项目总数-绩效状态")
        private Integer projectsTotalPerformance;

        @ApiModelProperty("项目总数-注销状态")
        private Integer projectsTotalLogOff;
    }

    @Data
    public static class ExcellentData {
        @ApiModelProperty("优秀项目-最佳应用")
        private Integer excellentBestAppNum;

        @ApiModelProperty("优秀项目-重大应用")
        private Integer excellentMajorAppNum;

        @ApiModelProperty("优秀项目-跨域共享数")
        private Integer excellentCrossDomainSharingNum;

        @ApiModelProperty("优秀项目-跨域共享数")
        private Integer excellentCrossLevelSharingNum;

        @ApiModelProperty("优秀项目-列表")
        private List<ExcellentProjects> excellentProjects;
    }

    @Data
    public static class ExcellentProjects {
        @ApiModelProperty("项目CODE")
        private String projectCode;

        @ApiModelProperty("项目名")
        private String projectName;

        @ApiModelProperty("项目简介")
        private String projectIntroduction;

        @ApiModelProperty("标签")
        private List<Tag> tags;
    }

    @Data
    public static class ReduceData {
        @ApiModelProperty("核减资金")
        private BigDecimal reduceFundsTotal;

        @ApiModelProperty("驳回节约资金")
        private BigDecimal rejectSavingsFunds;

        @ApiModelProperty("资金对比图")
        private List<AmountComparisonChart> amountComparisonCharts;
    }

    @Data
    public static class AmountComparisonChart {
        public AmountComparisonChart (String statusName,BigDecimal declaredAmount,BigDecimal approvalAmount,BigDecimal differenceAmount){
            this.statusName = statusName;
            this.declaredAmount = declaredAmount;
            this.approvalAmount = approvalAmount;
            this.differenceAmount = differenceAmount;
        }

        @ApiModelProperty("状态名")
        private String statusName;

        @ApiModelProperty("申报金额")
        private BigDecimal declaredAmount;

        @ApiModelProperty("批复金额")
        private BigDecimal approvalAmount;

        @ApiModelProperty("差额")
        private BigDecimal differenceAmount;
    }

    @Data
    public static class ProduceData {
        @ApiModelProperty("产出-应用数量")
        private Integer produceAppNum;
        @ApiModelProperty("产出-数据产品")
        private Integer produceDataNum;
        @ApiModelProperty("产出-组件数")
        private Integer produceComponentNum;
        @ApiModelProperty("产出-大脑要素")
        private Integer produceBrainElementsNum;
        @ApiModelProperty("产出-大脑要素")
        private Integer produceBrainModelNum;
    }

    @Data
    public static class PerformanceData {
        @ApiModelProperty("绩效-项目总数量")
        private Integer performanceTotal;

        @ApiModelProperty("绩效-未评价数量")
        private Integer performanceTobeReviewTotal;

        @ApiModelProperty("绩效-已评价数量")
        private Integer performanceReviewedTotal;

        @ApiModelProperty("绩效-top数据")
        private List<PerformanceTop> performanceTops;
    }

    @Data
    public static class PerformanceTop {
        public PerformanceTop (String topName,BigDecimal score,String appName){
            this.topName = topName;
            this.score = score;
            this.appName = appName;
        }

        @ApiModelProperty("绩效-top")
        private String topName;

        @ApiModelProperty("分数")
        private BigDecimal score;

        @ApiModelProperty("应用名称")
        private String appName;
    }
}