Exemplo n.º 1
0
 /**
  * 订单价格备注详情
  *
  * @param orderId
  * @param response
  * @throws IOException
  */
 @RequestMapping(value = "/order/priceMessageDetail/{orderId}")
 public void priceMessageDetailByOrderId(
     @PathVariable("orderId") long orderId, HttpServletResponse response) throws IOException {
   OrderDetail orderDetail = new OrderDetail();
   List<OrderDetail> list = new LinkedList<OrderDetail>();
   Order order = tradeCenterBossClient.queryOrderById(orderId);
   if (order.getPriceMessageDetail() != null) {
     orderDetail.setPriceMessageDetail(order.getPriceMessageDetail());
     list.add(orderDetail);
   }
   new JsonResult(true)
       .addData("totalCount", list.size())
       .addData("result", list)
       .toJson(response);
 }
Exemplo n.º 2
0
  /**
   * 后台订单的筛选地址
   *
   * @param orderQuery
   * @param response
   * @throws IOException
   */
  @RequestMapping(value = "/order/search")
  public void searchOrder(OrderQuery orderQuery, HttpServletResponse response) throws IOException {
    List<OrderDetail> list = new ArrayList<OrderDetail>();
    Page<Order> orderPage = tradeCenterBossClient.searchOrderByQuery(orderQuery);
    for (Order order : orderPage.getResult()) {
      OrderDetail orderDetail = new OrderDetail();
      orderDetail.setUserId(order.getUserId());
      orderDetail.setUserName(order.getUserName());
      orderDetail.setOrderId(order.getId());
      orderDetail.setOrderNo(order.getOrderNo());
      orderDetail.setAccountType(order.getAccountType());
      if (order.getOrderState() == OrderState.Success) {
        orderDetail.setEndDate(
            DateUtils.formatDate(order.getEndDate(), DateUtils.DateFormatType.DATE_FORMAT_STR));
      }
      orderDetail.setStartDate(
          DateUtils.formatDate(order.getCreateDate(), DateUtils.DateFormatType.DATE_FORMAT_STR));
      orderDetail.setInvoice(order.getInvoiceInfo().isInvoice());
      orderDetail.setOrderState(order.getOrderState().toString());
      orderDetail.setOrderStateDesc(order.getOrderState().serviceDesc());

      Logistics logistics = tradeCenterBossClient.queryLogisticsByOrderId(order.getId());
      orderDetail.setGoodToUserName(logistics.getName());

      list.add(orderDetail);
    }
    new JsonResult(true)
        .addData("totalCount", orderPage.getTotalCount())
        .addData("result", list)
        .toJson(response);
  }