コード例 #1
0
  private String invoice(Order order) {
    // 不需要开发票
    if (!order.getInvoiceInfo().isInvoice()) return "";

    StringBuilder sbd = new StringBuilder("发票: (");
    sbd.append(order.getInvoiceInfo().getInvoiceType()).append("/");
    sbd.append(order.getInvoiceInfo().getInvoiceTitle().toDesc()).append("/");

    if (StringUtils.isNotBlank(order.getInvoiceInfo().getCompanyName()))
      sbd.append(order.getInvoiceInfo().getCompanyName()).append("/");

    sbd.append(order.getInvoiceInfo().getInvoiceContent()).append(")");
    return sbd.toString();
  }
コード例 #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);
  }
コード例 #3
0
  /**
   * 显示订单的发票信息,客服也可修改,修改后的和原来的用-隔开
   *
   * @param orderId
   * @param response
   * @throws IOException
   */
  @RequestMapping(value = "/order/invoice/{orderId}")
  public void invoiceInfoGrid(@PathVariable("orderId") long orderId, HttpServletResponse response)
      throws IOException {
    Order order = tradeCenterBossClient.queryOrderById(orderId);
    List<InvoiceVoInfo> list = new LinkedList<InvoiceVoInfo>();
    if (order != null) {
      InvoiceInfo change = tradeCenterBossClient.queryOrderInvoiceInfoRedundancy(orderId);
      InvoiceVoInfo invoiceInfo = new InvoiceVoInfo();
      invoiceInfo.setInvoiceContent(order.getInvoiceInfo().getInvoiceContent());
      invoiceInfo.setInvoiceTitle(order.getInvoiceInfo().getInvoiceTitle().toDesc());
      invoiceInfo.setInvoiceType(order.getInvoiceInfo().getInvoiceType());
      invoiceInfo.setCompanyName(order.getInvoiceInfo().getCompanyName());

      if (StringUtils.isNotEmpty(change.getInvoiceContentRewrite())) {
        invoiceInfo.setInvoiceContent(
            invoiceInfo.getInvoiceContent() + Old_New_Gap + change.getInvoiceContentRewrite());
      }
      if (change.getInvoiceTitleRewrite() != null) {
        invoiceInfo.setInvoiceTitle(
            invoiceInfo.getInvoiceTitle() + Old_New_Gap + change.getInvoiceTitleRewrite().toDesc());
      }
      if (StringUtils.isNotEmpty(change.getInvoiceTypeRewrite())) {
        invoiceInfo.setInvoiceType(
            invoiceInfo.getInvoiceType() + Old_New_Gap + change.getInvoiceTypeRewrite());
      }
      if (StringUtils.isNotEmpty(change.getCompanyNameRewrite())) {
        String companyName = invoiceInfo.getCompanyName();
        if (StringUtils.isNotEmpty(companyName)) {
          invoiceInfo.setCompanyName(companyName + Old_New_Gap + change.getCompanyNameRewrite());
        } else {
          invoiceInfo.setCompanyName("不开公司发票^" + change.getCompanyNameRewrite());
        }
      }
      invoiceInfo.setOrderState(order.getOrderState().toString());
      list.add(invoiceInfo);
    }
    new JsonResult(true).addData("totalCount", 1).addData("result", list).toJson(response);
  }