final ObjectMapper mapper = new ObjectMapper();
final String jsonData = creditRiskService.getJsonData(reportConsumerEntity.getJsonDataRef());
final Object map = mapper.readValue(jsonData, Object.class); //json数据转为对象
final JSONObject jsObj = JSON.parseObject(jsonData, JSONObject.class); //将json字符串转为JsonObject对象 final JSONObject js = JSON.parseObject(jsObj.getString("feature"), JSONObject.class);
model.asMap().put("seven", js.get("7天贷款次数"));
objectMapper.writeValueAsString //将对象转json字符串
|