PoiEL.java 911 Bytes
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.utils.StringUtils;


import java.util.List;

public class PoiEL {
    public  String map(Object object){
        return map(object,null);
    }
    public  String map(Object object ,String fieldName){
        if (null==object){
            return "-";
        }
        if (object instanceof String){
            return StringUtils.isNotEmpty(object.toString())?object.toString(): "-";
        }
        if (object instanceof List){

        }
        JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(object));
        if (!jsonObject.containsKey(fieldName)){
            return "-";
        } else if (StringUtils.isEmpty(jsonObject.getString(fieldName))) {
            return "-";
        } else{
            return jsonObject.getString(fieldName);
        }
    }
    public  String test(){
        return "-";
    }


}