/** * 备注列表 * * @param orderId * @param response * @throws IOException */ @RequestMapping(value = "/order/message/{orderId}") public void displayOrderMessage( @PathVariable("orderId") long orderId, HttpServletResponse response) throws IOException { List<OrderMessage> orderMessages = tradeCenterBossClient.queryAllMessage(orderId); for (OrderMessage orderMessage : orderMessages) { orderMessage.setMessageInfo( orderMessage.getUserType().toDesc() + ":" + orderMessage.getMessageInfo()); } new JsonResult(true) .addData("totalCount", orderMessages.size()) .addData("result", orderMessages) .toJson(response); }
private String message(long orderId) { StringBuilder sbd = new StringBuilder(); List<OrderMessage> orderMessages = tradeCenterBossClient.queryAllMessage(orderId); int i = 0; for (OrderMessage orderMessage : orderMessages) { sbd.append(orderMessage.getUserType().toDesc()) .append("留言:") .append(orderMessage.getMessageInfo()); if (i != orderMessages.size() - 1) sbd.append("\n"); i++; } return sbd.toString(); }