package com.bcxin.ars.strategy.ministerial;

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

import java.lang.reflect.Field;

/**
 * @author zhangyutong
 */
public class PoliceOrgCodeMinDataFormatStrategy implements MinDataFormatStrategy {
    @Override
    public String format(Field columnField, Object data) {
        if(data == null){
            MinisterialAttr resource = columnField.getAnnotation(MinisterialAttr.class);
            return resource.defaultValue();
        }
        String code = (String) data;
        if (data != null && code.length() == 2) {
            code += "0000000000";
        }
        return code;
    }
}
