// 关键代码
int disableDecimalFeature = JSON.DEFAULT_PARSER_FEATURE & ~Feature.UseBigDecimal.getMask();
String str = JSON.toJSON(testEntity).toString();
//JSONObject JB = JSON.parseObject(str);
JSONObject JB = JSON.parseObject(str,JSONObject.class,disableDecimalFeature);
原文地址:https://blog.csdn.net/Jeremykim1026/article/details/102784658