예제 #1
0
 public void ackReqRet(int orders_id) {
   Orders orders = dataServer.get_orders(orders_id);
   // 给买家退钱
   dataServer.increaseBalance(orders.buyer_id, orders.money);
   Administrator administrator = new Administrator();
   dataServer.decreaseBalance(administrator.username, orders.money);
   dataServer.remove_an_orders(orders_id);
   // 提醒买家卖家地址
   Buyer buyer = new Buyer(orders.buyer_id);
   Seller seller = new Seller(orders.seller_id);
   String book_name = dataServer.get_book_name(orders.book_id);
   String book_num = orders.book_num + "";
   Message addrInfo = new Message(Message.RESP_ADDR, seller.getAddress(), book_name, book_num);
   seller.sendMessage(buyer, addrInfo);
 }
예제 #2
0
 public static void main(String[] args) {
   Seller seller = new Seller("invoker");
   System.out.println(seller.getFinishedOrdersList());
 }