package com.ruoyi.syzy.dto;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.syzy.domain.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import com.fasterxml.jackson.annotation.JsonInclude;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.BeanUtils;

@ApiModel("院校详情数据")
@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
public class UniversityDetailDTO {

    @ApiModelProperty("基础信息")
    private BBusiWishUniversities baseInfo;

    @ApiModelProperty("学校概况")
    private String overview;

    @ApiModelProperty("招生简章列表")
    private List<Zsjz> zsjzs;

    @ApiModelProperty("开设专业列表")
    private List<Marjors> marjors;

    @ApiModelProperty("院系及专业列表")
    private List<BBusiWishUniversitiesDepartment>  departments;

    @ApiModelProperty("特色专业")
    private List<BBusiWishUniversitiesProfession> professions;

    @ApiModelProperty("院校重点&双一流")
    private Map<String,List<BBusiWishUniversitiesSubject>> subjects;

    //学科评估
    @ApiModelProperty("学科评估")
    List<BBusiWishUniversitiesSubjectevaluate> subjectevaluates;

    //就业报告
    @ApiModelProperty("就业报告")
    List<BBusiWishUniversitiesEmploymentreport> employmentreports;
    @ApiModelProperty("动态、招生简章")
    List<BBusiWishUniversitiesEnrollBrochure> enrollBrochures;

    List<WishPlan> planHistories;

    List<WishSubmit> enrollHistories;


    @ApiModel("招生简章")
    public static class Zsjz {
        @ApiModelProperty("标题")
        private String title;
        @ApiModelProperty("详情")
        private String remark;

        public String getTitle() {
            return title;
        }

        public Zsjz setTitle(String title) {
            this.title = title;
            return this;
        }

        public String getRemark() {
            return remark;
        }

        public Zsjz setRemark(String remark) {
            this.remark = remark;
            return this;
        }

    }

    @ApiModel("开设专业")
    public static class Marjors {
        @ApiModelProperty("专业分类")
        private String name;
        @ApiModelProperty("专业名称")
        private List<String> children;

        public String getName() {
            return name;
        }

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

        public Marjors addChildren(String child) {
            child = StringUtils.trimToEmpty(child);
            if (null == children) {
                children = new ArrayList<String>();
            }
            if (children.contains(child)) {
                return this;
            }
            children.add(child);
            return this;
        }

        public List<String> getChildren() {
            return children;
        }

        public void setChildren(List<String> children) {
            this.children = children;
        }

    }

    @ApiModel("招生计划")
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class WishPlan {
        private Long id;
        private String collegeCode;
        private String year;
        private String level;
        @JsonProperty("examMajor")
        private String type;
        @JsonProperty("majorGroup")
        private String groupsName;
        @JsonProperty("majorCode")
        private String marjorCode;
        @JsonProperty("majorName")
        private String marjorName;
        @JsonProperty("enrollCode")
        private String marjorBelongs;
        private String marjorDirection;
        private String specialProject;
        @JsonProperty("planNum")
        private Integer planCount;
        @JsonProperty("fee")
        private String xuefei;
        @JsonProperty("xueZhi")
        private String xuezhi;
        @JsonProperty("totalRule")
        private String enrollFormula;
        @ApiModelProperty("报录比")
        @JsonProperty("acceptanceRate")
        private String acceptanceRate;
        @ApiModelProperty("报名数")
        @JsonProperty("enrollCount")
        private Integer enrollCount;

        public WishPlan(BBusiWishUniversitySubmitRecruitPlan plan) {
            BeanUtils.copyProperties(plan, this);
        }
    }

    @ApiModel("招生录取")
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class WishSubmit {
        private Long id;
        private String year;
        private String level;
        @JsonProperty("examMajor")
        private String type;
        @JsonProperty("majorGroup")
        private String groupsName;
        @JsonProperty("majorCode")
        private String marjorCode;
        @JsonProperty("majorName")
        private String marjorName;
        @JsonProperty("enrollCode")
        private String marjorBelongs;
        @Excel(name = "专业方向")
        private String marjorDirection;
        private String specialProject;
        @JsonProperty("minScore")
        private Long score;
        @JsonProperty("minSeat")
        private Long seat;
        @JsonProperty("realNum")
        private Long numReal;
        @JsonProperty("totalRule")
        private String enrollFormula;

        public WishSubmit(BBusiWishUniversitySubmitMarjors submit) {
            BeanUtils.copyProperties(submit, this);
        }
    }
}
