package com.bcxin.ars.strategy.ministerial;


import com.abcxin.smart.validator.annotation.MinisterialAttr;

import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;

/**
 * 文化程度
 * @author linqinglin
 * @date 2021/03/06 0006 13:20
 */
public class EduMinDataFormatStrategy implements MinDataFormatStrategy {
    @Override
    public String format(Field columnField, Object data) {

        if(data == null){
            MinisterialAttr resource = columnField.getAnnotation(MinisterialAttr.class);
            return resource.defaultValue();
        }

        Map<String,String> eduMap = new HashMap<>();
        eduMap.put("1","81");//小学
        eduMap.put("2","71");//初中
        eduMap.put("3","61");//高中
        eduMap.put("4","41");//中专
        eduMap.put("5","31");//大专
        eduMap.put("6","21");//本科
        eduMap.put("7","14");//硕士研究生
        eduMap.put("8","11");//博士
        eduMap.put("9","90");//博士后
        eduMap.put("10","90");//其他

        return eduMap.get(data);
    }



}
