BigDecimal 转换为Integer 异常,数据库查询回来默认封装成BigDecimal了,我们可以设置读取的时要转换成Integer.class就行
import com.alibaba.fastjson.JSONObject;
JSONObject.parseObject(map.get("quantity").toString(), Integer.class);
// 可以使用fastjson的api来设置转换的类对象,直接转Integer.class
// 方法二
import com.alibaba.fastjson.JSON;
JSON.parseObject()