Exemplo n.º 1
0
  public String showEditUpdate() {
    Seller seller = (Seller) getSession().getAttribute(FrontContainer.SELLER_INFO);
    if (seller == null || StringUtils.isBlank(seller.getOwner_mobile())) {
      return "toLogin";
    }
    String imgTitle = getRequest().getParameter("indexImg.title");
    String picture = getRequest().getParameter("indexImg.picture");
    String order1 = getRequest().getParameter("indexImg.order1");
    IndexImg indexImg1 = new IndexImg();
    indexImg1.setTitle(imgTitle);
    indexImg1.setPicture(picture);
    if (StringUtils.isNotBlank(order1)) {
      indexImg1.setOrder1(Integer.valueOf(order1));
    }

    indexImg1.setOwner_id(seller.getId());
    indexImgService.update(indexImg1);
    IndexImg indexImg2 = new IndexImg();
    indexImg2.setOwner_id(seller.getId());
    indexImgs = indexImgService.selectList(indexImg2);
    indexImgSize = indexImgs.size();

    selectLeftMenu = "show";
    e = sellerService.selectById(seller.getId());
    setSelectMenu(FrontContainer.not_select_menu); // 设置主菜单为不选中
    return "showpage";
  }
Exemplo n.º 2
0
  public String showUpdate() {
    Seller seller = (Seller) getSession().getAttribute(FrontContainer.SELLER_INFO);
    if (seller == null || StringUtils.isBlank(seller.getOwner_mobile())) {
      return "toLogin";
    }
    String imgTitle = getRequest().getParameter("e.title");
    String picture = getRequest().getParameter("e.show_img");
    if (picture != null && !picture.isEmpty()) {
      if (picture.startsWith("/JJShop")) {
        picture = picture.substring(picture.indexOf("/JJShop"));
      }
    }
    String order1 = getRequest().getParameter("e.order1");

    IndexImg indexImg1 = new IndexImg();
    indexImg1.setTitle(imgTitle);
    indexImg1.setPicture(picture);
    if (StringUtils.isNotBlank(order1)) {
      Pattern p = Pattern.compile("\\d+");
      Matcher m = p.matcher(order1);
      if (m.find()) {
        indexImg1.setOrder1(Integer.valueOf(order1));
      } else {
        indexImg1.setOrder1(1);
      }

    } else {
      indexImg1.setOrder1(1);
    }

    indexImg1.setOwner_id(seller.getId());
    indexImgService.insert(indexImg1);
    IndexImg indexImg2 = new IndexImg();
    indexImg2.setOwner_id(seller.getId());
    indexImgs = indexImgService.selectList(indexImg2);
    indexImgSize = indexImgs.size();

    selectLeftMenu = "show";
    e = sellerService.selectById(seller.getId());
    setSelectMenu(FrontContainer.not_select_menu); // 设置主菜单为不选中
    return "showpage";
  }