List 转 JSON 字符串
Map<String,String> map = new HashMap<>();
map.put("name","szy");
map.put("num",2);
list.add(map);
String inventoryResultStr = JSON.toJSON(list).toString();
JSON字符串转List
List inventoryResultList = JSONObject.parseArray(inventoryResult);
for(Integer i=0;i<inventoryResultList.size();i++){
JSONObject jsonObject = (JSONObject) inventoryResultList.get(i);
String name =jsonObject.getString("name");
}