DlwyComplaints complaints = new DlwyComplaints(); complaints.setAppid(appid); complaints.setOpenid(openid); List<DlwyComplaints> complaintsList = complaintsServiceClient.getAll(complaints); if (null != complaintsList && complaintsList.size() > 0){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); JSONArray ja = new JSONArray(); JSONObject jo = new JSONObject(); for (DlwyComplaints co: complaintsList) { jo.put("id",co.getId()); jo.put("title",co.getTitle()); jo.put("content",co.getContent()); jo.put("compTime",sdf.format(co.getCompTime())); ja.add(jo); } /*String result = JSONArray.fromObject(complaintsList).toString();*/ return R.ok(ja.toString()); }else { return R.error("未查到信息"); }
查询列表信息转换
最新推荐文章于 2024-10-29 14:46:12 发布