//将建json对象转换为EnterpriseTurnOverResultVo对象
EnterpriseTurnOverResultVo jb = (EnterpriseTurnOverResultVo)JSONObject.toJavaObject(jsonObject,EnterpriseTurnOverResultVo.class);
{
"enterpriseTurnOverResultVoArrayList":[
{
"enterpriseAddress":"浙江省杭州市滨江区滨江大道滨康小区江陵路地铁口145号",
"enterpriseId":"564549af856247bbb05e8699d9f52adc",
"enterpriseName":"老娘舅1号店"
}
],
"remark":"不正规"
}
//json格式取其中数组
List<EnterpriseTurnOverResultVo> list = JSON.parseArray(JSON.parseObject(ByteArrayAndString.byteArrayToStr(enterpriseTransfer.getExt())).getString("enterpriseTurnOverResultVoArrayList"), EnterpriseTurnOverResultVo.class);
//json格式取remark字段
String remark = JSON.parseObject(ByteArrayAndString.byteArrayToStr(enterpriseTransfer.getExt())).getString("remark");
网友评论