Examples of Orders


Examples of com.ateam.webstore.model.Orders

    l.finer("->");
    OrderShippingForm osf;
   
    try {
      osf = getOrderShippingRequest();
      Orders order = (Orders) req.getSession().getAttribute(SESSION_ATTRIBUTE_ORDER);
     
      order.setShippingCode(osf.getShippingCode());
      order.setAddress(osf.getAddress());

      //FormSubmission fs = new FormSubmission();
      osf.setSuccess(true);
      osf.setResultView(getOrderPaymentView());
View Full Code Here

Examples of com.ateam.webstore.model.Orders

   */
  public FormSubmission processOrderConfirmationRequest() {
   
    FormSubmission submission = new FormSubmission();
       
    Orders order = (Orders) req.getSession().getAttribute(SESSION_ATTRIBUTE_ORDER);
    Collection<ItemsOrdered> items = (Collection<ItemsOrdered>) req.getSession().getAttribute(SESSION_ATTRIBUTE_ORDERED_ITEMS);
   
    try {
      order = service.store(order);
      l.info("order "+order.getId()+" created");
      ItemsOrderedService is = new ItemsOrderedService();
      for (ItemsOrdered item : items) {
        item.setOrders(order);
        is.store(item);
        l.info("item "+item.getProduct().getId()+" added to order");
View Full Code Here

Examples of com.ateam.webstore.model.Orders

   * @return
   */
  public FormSubmission processOrderPaymentRequest() {
    OrderPaymentForm opf = getOrderPaymentRequest();

    Orders order = (Orders) req.getSession().getAttribute(SESSION_ATTRIBUTE_ORDER);
   
    order.setCreditCard(opf.getCard());
   
    SalesTaxService sts = new SalesTaxService();
    SalesTax st = sts.getById(opf.getCard().getBillingAddress().getState());
    Double tax = 10.00;
    if (st != null) {
      tax = st.getPercent()/100 * order.getItemSubTotal();
    }
    order.setSalesTax(tax);
   
    opf.setSuccess(true);
    opf.setResultView(getOrderPreView());
     
    return opf;
View Full Code Here

Examples of com.ateam.webstore.model.Orders

  public FormSubmission processOrderUpdateRequest() {
    FormSubmission fs = new FormSubmission();
   
    l.info("order update");
   
    Orders o = getOrder();
   
    String action = req.getParameter(Parameters.ORDER_CONFIRM.getId());
   
    if (action.equals("Update Order")) {
     
      if (req.getParameter(Parameters.TRACKING_NUMBER.getId()) != null) {
        o.setTrackingNumber(req.getParameter(Parameters.TRACKING_NUMBER.getId()));
        o.setTimeShipped(new Date(new java.util.Date().getTime()));
        fs.setResultMessage("Order Updated");
      }
      else {
        fs.setResultMessage("Invalid Tracking Number");
        fs.setResultView(getOrderDetailsView(null, true));
        return fs;
      }
     
    }
    else if (action.equals("Cancel Order")) {
      o.setReturnInd(true);
      fs.setResultMessage("Order Cannceled");
    }
   
    fs.setResultView(getOrderDetailsView(null, true));
    service.store(o);
View Full Code Here

Examples of com.ateam.webstore.model.Orders

      return view;
    }
   
    l.info("start checkout for session: "+req.getSession().getId());
   
    Orders order = new Orders(cart.getProducts().size(), 0.0, 0.0, 0.0, v.getCustomer(), null, null, null);
   
    Collection<ItemsOrdered> items = new ArrayList<ItemsOrdered>();
    for (ProductsInCart prod : cart.getProducts()) {
      ItemsOrdered item = new ItemsOrdered(prod.getProduct().getSalesPrice(), prod.getQuantity(), false, null, prod.getProduct());
      items.add(item);
      order.addItemPrice(prod.getProduct().getSalesPrice());
    }
   
   
   
    //Add order to session
View Full Code Here

Examples of com.lgx8.gateway.entities.Orders

  @Transactional
  public Orders findCartByUserId(User user) {
    String hql = "from Orders o where o.status="+Orders.STATUS_CART+" and o.user.id="+user.getId();
    List<Orders> list = getHibernateTemplate().find(hql);
    if(list==null||list.size()==0) {
      Orders o = new Orders();
      //o.setId(System.currentTimeMillis());
      o.setUser(user);
      o.setStatus(Orders.STATUS_CART);
      o.setShoppingtime(new Date());
      createOrders(o);
      return o;
    } else {
      return list.get(0);
    }
View Full Code Here

Examples of com.lgx8.gateway.entities.Orders

     
//      String[] ids = idStr.split(",");
     
      List<Orders> orderList = orderService.queryOrders("from Orders o where o.id in ("+idStr+")", new Object[]{});
      if(null!=orderList&&orderList.size()>0){
        Orders order = orderList.get(0);
        order.setConfirmtime(new Date());
        order.setStatus(Orders.STATUS_CONFIRM);
        orderService.updateOrder(order);
      }
      //跳转
      response.setContentType("text/html;charset=UTF-8");
      PrintWriter out = response.getWriter();
View Full Code Here

Examples of com.lgx8.gateway.entities.Orders

      out.flush();
      out.close();
      return;
    }
   
    Orders order = ordersService.createOrderProduct(user.getId(), productid, lcount, color, clothesize, shoesize);
   
    String result = "";
    if(order==null) {
      result = "$(\"#mini-cart-count\").html(0);";
      result += "$(\"#J-mini-cart-full\").hide();";
      result += "$(\"#J-mini-cart-empty\").show();";
      out.print(result);
      out.flush();
      out.close();
      return;
    } else if(order.getOrderProducts().size()==0) {
      result = "$(\"#mini-cart-count\").html(0);";
      result += "$(\"#J-mini-cart-full\").hide();";
      result += "$(\"#J-mini-cart-empty\").show();";
      out.print(result);
      out.flush();
      out.close();
      return;
    }
    /*Product product = gatewayService.findProductById(productid);
   
    OrderProduct op = new OrderProduct();
   
    op.setOrders(order);
    op.setProduct(product);
    op.setName(product.getName());
    op.setPrice(product.getPrice());
    op.setAmount(lcount);
    op.setDescription(product.getDescription());
    op.setBrand(product.getBrand()==null?"":product.getBrand().getName());
    op.setImage(product.getImage().getLargeURL());
    op.setAreacategoryname(product.getAreaCategory().getName());
    op.setCategoryname(product.getCategory().getName());
   
    order.addOrderProduct(op);
   
    ordersService.createOrderProduct(op);*/
   
    result += "$(\"#J-mini-cart-full\").show();";
    result += "$(\"#J-mini-cart-empty\").hide();";
   
    result += "$(\"#mini-cart-count\").html("+order.getAmount()+");";
    result += "$(\"#optotal\").html('<em>"+order.getAmount()+"</em>件商品 总计<em>"+order.getAmountPrice()+"</em><span>积分</span>');";
   
    String cart = order.toOrderString();
   
    cart = "$(\"#J-mini-cart-full\").html('"+cart+"');";
   
   
    result += cart;
View Full Code Here

Examples of com.lgx8.gateway.entities.Orders

      out.close();
      return;
    }
   
    ordersService.deleteOrderProduct(new Long(id));
    Orders order = ordersService.findCartByUserId(user.getId());
    String result = "";
    result = "$(\"#mini-cart-count\").html("+order.getAmount()+");";
    result += "$(\"#optotal\").html('<em>"+order.getAmount()+"</em>件商品 总计<em>"+order.getAmountPrice()+"</em><span>积分</span>');";
   
   
    out.print(result);
    out.flush();
    out.close();
View Full Code Here

Examples of com.lgx8.gateway.entities.Orders

      String color, String clothesize, String shoesize) {
    User user = userDao.findUserById(userid);
    if (user == null) {
      return null;
    }
    Orders order = orderDao.findCartByUserId(user);

    Product product = productDao.getProductById(productid);

    OrderProduct op = new OrderProduct();

    op.setOrders(order);
    op.setProduct(product);
    op.setName(product.getName());
    op.setPrice(product.getPrice());
    op.setAmount(count);
    op.setColor(color);
    op.setClothessize(clothesize);
    op.setShoesize(shoesize);
    op.setDescription(product.getDescription());
    op.setBrand(product.getBrand() == null ? "" : product.getBrand()
        .getName());
    op.setImage(product.getImage().getLargeURL());
    op.setAreacategoryname(product.getAreaCategory().getName());
    op.setCategoryname(product.getCategory().getName());
    op.setUrl(product.getUrl());

    // 有无类似能合并的商品
    boolean flag = false;
    // 判断有无合并的商品
    for (OrderProduct old : order.getOrderProducts()) {
      if (old.isOneProduct(op)) {
        flag = true;
        old.mergeOrderProduct(op);
        orderDao.updateOrderProduct(old);
        break;
      }
    }
    if (!flag) {
      order.addOrderProduct(op);
      orderDao.createOrderProduct(op);
    }
    return order;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.