package com.ruoyi.web.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.syzy.domain.BBusiWishUniversities;
import com.ruoyi.syzy.domain.BBusiWishUniversitySubmitMarjors;
import com.ruoyi.syzy.domain.BBusiWishUniversitySubmitRecruitPlan;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

@Data
public class ZytbDto {
    //二、专业详情
    @Data
    public static class ZytbVoluntaryMarjorCond {
        //2.1入参：collegeCode 招生专业组编码，year年份
        private String universityId;
        @JsonProperty("jCode")
        private String jCode;
        private String collegeCode;
        private Integer year;
        private String mode;
        private String batchName;
        private Integer score;
        private Integer batchMinScore;
        private Long wishResId; // 指定志愿表Id
    }

    @Data
    public static class ZytbVoluntaryMarjorDetail {
        //2.2返参
        //（1）majorName,marjorDirection,marjorBelongs,planCount,xuefei,xuezhi,
        private Long id;
        private String marjorId;
        private String marjorBelongs;
        private String marjorName;
        private String marjorDirection;
        private Integer planCount;
        private String xuefei;
        private String xuezhi;
        //（2）该专业历史数据
        @ApiModelProperty("推荐方式:0-冲刺,1-稳妥,2-保守")
        private Integer pickType;
        private Integer enrollOver = 0; // 1(上溢出0%) 0 -1(下溢出100%)
        private Integer enrollRatio;
        private String enrollRatioText;

        private String professionType;
        private List<String> typeNames;
        private String level;
        private Boolean enrollFluctuate;

        //numReal录取人数，lineDiff线差，score录取最低分，seat录取最低位次
        // 预留字段：enrollRatio,enrollRatioText
        private BBusiWishUniversitySubmitMarjors[] histories = new BBusiWishUniversitySubmitMarjors[4];
        private BBusiWishUniversitySubmitMarjors history;
    }

    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class ZytbVolunteerRes {
        //一、列表
        //1.1入参：（1 2 3）均为非必填
        // （1）分数Integer score，组合String mode（如物理,化学,生物）,mode1物理/历史或理科/文科，batchName批次（本科或专科），batch批次（1，2，3，4分别对应本科专科）
        // （2）学校基础参数：String managerType, type, level,features,natureTypeCN，universityName（院校名称）
        // （3）超稳保：Integer pickType （根据这个字段来计算学生使用哪个位次/分数来查找submit_major中的专业线）
        // （4）专业名称：List<String> majors，专业的中文名称，对应submit_major表中的marjorName及marjorDirection

        //1.2返参
        @ApiModelProperty("推荐方式:0-冲刺,1-稳妥,2-保守")
        private Integer pickType;
        @ApiModelProperty("专项说明")
        private String specialProject;
        @ApiModelProperty("录取概率溢出（预留字段）")
        private Integer enrollOver = 0; // 1(上溢出0%) 0 -1(下溢出100%)
        @ApiModelProperty("录取概率（预留字段）")
        private String enrollRatio;
        @ApiModelProperty("录取概率说明（预留字段）")
        //风险极大，风险中等，风险极小
        private String enrollRatioText;
        //院校基础信息
        //location,cityName, managerType, type, level,features,natureTypeCN,ranking,
        private Long universityId;
        @JsonProperty("jCode")
        private String jCode;
        private BBusiWishUniversities university;
        //招生计划（submit_recruit_plan表最新一年） ：
        // year年份，planCount计划数，course选科科目；
        // collegeCode 院校招生代码
        // majorCount 该专业组（collegeCode）下包含的专业数量
        private BBusiWishUniversitySubmitRecruitPlan recruitPlan;

        //历年数据（取submit_marjor表最近三年的专业组）：  numReal录取人数，lineDiff线差，score录取最低分，seat录取最低位次
        private BBusiWishUniversitySubmitMarjors[] histories = new  BBusiWishUniversitySubmitMarjors[4];
        private BBusiWishUniversitySubmitMarjors history;

        private List<ZytbVoluntaryMarjorDetail> marjorList;
    }
//
//    @Data
//    public static class ZytbCollegeRes {
//        Long universityId;
//        String name;
//        String collegeCode;
//        String universityCode;
//        List<ZytbSubmitMajorRes> submitMajors;
//    }
//
//    @Data
//    public static class ZytbSubmitMajorRes {
//        Long submitMarjorId;
//        String marjorBelongs;
//        String marjorName;
//        String marjorDirection;
//    }

    public static void main(String[] args) {
        String aa= "化学,生物";
        String[] bb = StringUtils.split(aa,",");
        System.out.println(bb);
        Collections.reverse(Arrays.asList(bb));
        String cc0= StringUtils.join(bb,",");
        System.out.println(cc0);
        System.out.println(cc0.equalsIgnoreCase("生物,化学"));
        String cc = Arrays.toString(bb);
        System.out.println(cc);
    }
}
