Exemplo n.º 1
0
  public String showDelete() {
    Seller seller = (Seller) getSession().getAttribute(FrontContainer.SELLER_INFO);
    if (seller == null || StringUtils.isBlank(seller.getOwner_mobile())) {
      return "toLogin";
    }
    String imgId = getRequest().getParameter("e.id");

    //        String picture = getRequest().getParameter("e.show_img");
    //        String order1 = getRequest().getParameter("e.order1");
    IndexImg indexImg1 = indexImgService.selectById(imgId);
    String picture = indexImg1.getPicture();
    // indexImg1.setPicture(picture);

    // indexImg1.setOwner_id(seller.getId());
    indexImgService.delete(indexImg1);
    // String realPath= ServletActionContext.getServletContext().getRealPath("/");
    String path = ServletActionContext.getServletContext().getRealPath("/") + picture;
    if (StringUtils.isNotBlank(path)) {
      // path = pDir + path;
      File file = new File(path);

      if (file.exists()) {
        deleteFile(file);
        // getResponse().getWriter().write("succeed");
      }
    }
    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 show();
  }
Exemplo n.º 2
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.º 3
0
  public String approve() {
    Seller seller = (Seller) getSession().getAttribute(FrontContainer.SELLER_INFO);
    if (seller == null || StringUtils.isBlank(seller.getOwner_mobile())) {
      return "toLogin";
    }

    selectLeftMenu = "approve";
    e = sellerService.selectById(seller.getId());
    setSelectMenu(FrontContainer.not_select_menu); // 设置主菜单为不选中
    return "approvepage";
  }
Exemplo n.º 4
0
  /*
   * 修改商家信息
   */
  public String save() {
    logger.error("saveSetting.....");
    logger.error(e);
    sellerService.update(e);
    Seller seller = (Seller) getSession().getAttribute(FrontContainer.SELLER_INFO);
    if (seller == null || StringUtils.isBlank(seller.getOwner_mobile())) {
      return "toLogin";
    }

    selectLeftMenu = "introduction";
    e = sellerService.selectById(seller.getId());
    setSelectMenu(FrontContainer.not_select_menu); // 设置主菜单为不选中
    // e.clear();
    return "seller";
  }
Exemplo n.º 5
0
  public String show() {
    Seller seller = (Seller) getSession().getAttribute(FrontContainer.SELLER_INFO);
    if (seller == null || StringUtils.isBlank(seller.getOwner_mobile())) {
      return "toLogin";
    }

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

    IndexImg indexImg2 = new IndexImg();
    indexImg2.setOwner_id(seller.getId());
    indexImgs = indexImgService.selectList(indexImg2);
    indexImgSize = indexImgs.size();
    return "showpage";
  }
Exemplo n.º 6
0
  public String showEdit() {
    Seller seller = (Seller) getSession().getAttribute(FrontContainer.SELLER_INFO);
    if (seller == null || StringUtils.isBlank(seller.getOwner_mobile())) {
      return "toLogin";
    }
    String imgId = getRequest().getParameter("e.id");

    IndexImg indexImg1 = new IndexImg();
    indexImg1.setId(imgId);

    indexImg1.setOwner_id(seller.getId());
    indexImg = indexImgService.selectOne(indexImg1);

    selectLeftMenu = "show";
    e = sellerService.selectById(seller.getId());
    setSelectMenu(FrontContainer.not_select_menu); // 设置主菜单为不选中
    return "showedit";
  }
Exemplo n.º 7
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";
  }
Exemplo n.º 8
0
  public String toShop() {
    String sellerID = getRequest().getParameter("sellerID");
    if (StringUtils.isBlank(sellerID)) {
      return null;
    }
    e.clear();
    // e.setOwner_id(sellerID);
    e = sellerService.selectById(sellerID);
    IndexImg indexImg1 = new IndexImg();
    indexImg1.setOwner_id(sellerID);
    // indexImg = indexImgService.getSellerImg(indexImg);
    // e.setIndexIMG(indexImg.getPicture());
    indexImgs = indexImgService.selectList(indexImg1);

    net.jeeshop.services.front.sellerproduct.bean.Product p =
        new net.jeeshop.services.front.sellerproduct.bean.Product();
    p.setOwner_id(sellerID);
    p.setStatus(2);
    List<net.jeeshop.services.front.sellerproduct.bean.Product> products =
        productService.selectList(p);
    e.setProducts(products);
    return "toSellerShop";
  }