Exemplo n.º 1
0
 @Test
 public void partialObjectQuery() {
   List<PurchaseDTO> dtoList = paymentDAO.getPurchaseByCustomer();
   for (PurchaseDTO purchaseDTO : dtoList) {
     System.out.println(purchaseDTO);
   }
 }
Exemplo n.º 2
0
  public void paymentTest() {
    Payment payment = new Payment();
    // 取出订单
    Order order = orderDAO.getOrderById(8);
    // 取出订单顾客
    Customer customer = order.getCustomer();
    // 取出操作员
    Worker worker = workerDAO.getWorkerById(7);
    // 取出银行卡
    Bankcard bankcard = customer.getBankcardList().get(0);

    payment.setPayCustomer(customer);
    System.out.println("OrderId:" + order.getOrderId());
    payment.setPayOrder(order);
    System.out.println(bankcard);
    payment.setPayCard(bankcard);
    payment.setPayPrice(order.getOrderPrice());
    payment.setPayType(1);
    payment.setWorker(worker);

    paymentDAO.createPayment(payment);
  }