Caused by: java.lang.ClassCastException: com.alibaba.fastjson.JSONObject cannot be cast to com.picchealth.hmbms.payment.pojo.Settle

json对象的转换问题:

  Object aa = map.get("settleList");
// for (int i = 0; i < settleList.size(); i++) {
// Settle settle = settleList.get(i);
// System.out.println(settle);
// }

String result=JSON.toJSONString(aa);
// List settleList = (List) JSONArray.(jsonObjString, Settle.class);
List settles = JSONArray.parseArray(result, Settle.class);
settles.get(1).getBatchNo();
这样写就不报错了

你可能感兴趣的:(Caused by: java.lang.ClassCastException: com.alibaba.fastjson.JSONObject cannot be cast to com.picchealth.hmbms.payment.pojo.Settle)