package com.ruoyi.syzy.criteria;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.fasterxml.jackson.annotation.JsonInclude;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel("志愿填报-院校查询条件")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ZytbUniversityCriteria implements java.io.Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1l;

    @ApiModelProperty("地域")
    private String location;
    @ApiModelProperty("院校类型:综合/工科...")
    private String type;
    @ApiModelProperty("专业类别")
    private String marjor;

    @ApiModelProperty("批次")
    private Integer batch;
    @ApiModelProperty("推荐方式:0-冲刺,1-稳妥,2-保守")
    private Integer pickType;
    @ApiModelProperty("类别:文科/理科")
    private String mode;
    @ApiModelProperty("年份")
    private String year;
    @ApiModelProperty("总分")
    private Float score;

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getMarjor() {
        return marjor;
    }

    public void setMarjor(String marjor) {
        this.marjor = marjor;
    }

    public Integer getBatch() {
        return batch;
    }

    public void setBatch(Integer batch) {
        this.batch = batch;
    }

    public Integer getPickType() {
        return pickType;
    }

    public void setPickType(Integer pickType) {
        this.pickType = pickType;
    }

    public String getMode() {
        return mode;
    }

    public void setMode(String mode) {
        this.mode = mode;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public Float getScore() {
        return score;
    }

    public void setScore(Float score) {
        this.score = score;
    }

    public static Map<Integer, String> getPickComment() {
        return pickComment;
    }

    public static void setPickComment(Map<Integer, String> pickComment) {
        ZytbUniversityCriteria.pickComment = pickComment;
    }

    public static Map<Integer, Integer[]> getScores() {
        return scores;
    }

    public static void setScores(Map<Integer, Integer[]> scores) {
        ZytbUniversityCriteria.scores = scores;
    }

    public String getLevel() {
        return null == batch ? null : Integer.valueOf(4).equals(batch) ? "高职(专科)" : "本科";
    }

    public String getPickTypeComment() {
        return null == pickType ? null : MapUtils.getString(pickComment, pickType);
    }

    public Integer getMinScore() {
        return null == pickType ? null : scores.get(pickType)[0];
    }

    public Integer getMaxScore() {
        return null == pickType ? null : scores.get(pickType)[1];
    }

    static Map<Integer, String> pickComment = new HashMap<Integer, String>(3);
    static Map<Integer, Integer[]> scores = new HashMap<Integer, Integer[]>(3);
    static {
        pickComment.put(Integer.valueOf(0), "冲刺");
        pickComment.put(Integer.valueOf(1), "稳妥");
        pickComment.put(Integer.valueOf(2), "保守");
        /**
         * 20210922：莫与徐总确认 学生分数如果是500分， 501-530，冲刺，上浮30分 500-486，稳妥，下浮15分 485-该批次最低分，保底
         **/
        // 线差小于3分为冲刺
        scores.put(Integer.valueOf(0), new Integer[] {-30, 0});
        // 线差小于12分为稳妥
        scores.put(Integer.valueOf(1), new Integer[] {0, 14});
        // 线差大于12分为保守
        scores.put(Integer.valueOf(2), new Integer[] {14, 999});
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }
}
