Ejemplo n.º 1
0
 /** 会员中心优惠劵 */
 @RequestMapping(value = "/myCoupon.jspx", method = RequestMethod.GET)
 public String pay1(HttpServletRequest request, ModelMap model) {
   Website web = SiteUtils.getWeb(request);
   ShopMember member = MemberThread.get();
   List<MemberCoupon> list = memberCouponMng.getList(member.getId());
   model.addAttribute("couList", list);
   model.addAttribute("historyProductIds", getHistoryProductIds(request));
   ShopFrontHelper.setCommonData(request, model, web, 1);
   return web.getTplSys("member", MessageResolver.getMessage(request, "tpl.myCoupon"));
 }
Ejemplo n.º 2
0
  // 选择收货地址、付款方式、配送方式
  @RequestMapping(value = "/cart/checkout_shipping.jspx")
  public String shippingInput(
      Long[] cart2Checkbox,
      HttpServletRequest request,
      HttpServletResponse response,
      ModelMap model) {
    Website web = SiteUtils.getWeb(request);
    ShopMember member = MemberThread.get();
    if (member == null) {
      return "redirect:../login.jspx";
    }
    Cart cart = shoppingSvc.getCart(member.getId());
    if (cart == null) {
      return "redirect:shopping_cart.jspx";
    }
    List<PopularityItem> popularityItems = null;
    Double popularityPrice = 0.0;
    if (cart != null) {
      popularityItems = popularityItemMng.getlist(cart.getId(), null);
      for (PopularityItem popularityItem : popularityItems) {
        popularityPrice +=
            popularityItem.getPopularityGroup().getPrivilege() * popularityItem.getCount();
      }
    }

    Set<CartItem> items = getItems(cart2Checkbox, cart);
    Double price = getPrice(items);
    // 配送方式
    List<Shipping> splist = shippingMng.getList(web.getId(), true);
    // 会员地址
    List<ShopMemberAddress> smalist = shopMemberAddressMng.getList(member.getId());
    // 所处省份
    List<Address> plist = addressMng.getListById(null);
    // 付款方式
    List<Payment> paylist = paymentMng.getList((long) 1, true);
    model.addAttribute(
        "memberCouponlist", memberCouponMng.getList(member.getId(), new BigDecimal(price)));
    model.addAttribute("items", getItems(cart2Checkbox, cart));
    model.addAttribute("smalist", smalist);
    model.addAttribute("plist", plist);
    model.addAttribute("paylist", paylist);
    model.addAttribute("splist", splist);
    model.addAttribute("popularityPrice", popularityPrice);
    ShopFrontHelper.setCommonData(request, model, web, 1);
    return web.getTplSys(MEMBER_SYS, MessageResolver.getMessage(request, CHECKOUT_SHIPPING));
  }
Ejemplo n.º 3
0
 // 购物车
 @RequestMapping(value = "/cart/shopping_cart.jspx")
 public String shoppingCart(
     String backUrl, HttpServletRequest request, HttpServletResponse response, ModelMap model) {
   ShopMember member = MemberThread.get();
   if (member == null) {
     return "redirect:../login.jspx";
   }
   Website web = SiteUtils.getWeb(request);
   Cart cart = shoppingSvc.getCart(member, request, response);
   List<PopularityItem> popularityItems = null;
   if (cart != null) {
     popularityItems = popularityItemMng.getlist(cart.getId(), null);
   }
   model.addAttribute("cart", cart);
   if (!StringUtils.isBlank(backUrl)) {
     model.addAttribute(BACK_URL, backUrl);
   }
   model.addAttribute("popularityItems", popularityItems);
   ShopFrontHelper.setCommonData(request, model, web, 1);
   return web.getTplSys(MEMBER_SYS, MessageResolver.getMessage(request, SHOPPING_CART));
 }