Exemple #1
0
  public String approveUpdate() {

    Seller seller = (Seller) getSession().getAttribute(FrontContainer.SELLER_INFO);
    if (seller == null || StringUtils.isBlank(seller.getOwner_mobile())) {
      return "toLogin";
    }
    // e = sellerService.selectById(seller.getId());
    selectLeftMenu = "approve";
    setSelectMenu(FrontContainer.not_select_menu); // 设置主菜单为不选中
    sellerService.update(e);
    e = sellerService.selectById(seller.getId());
    return "approvepage";
    // return "seller";
  }
Exemple #2
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";
  }
Exemple #3
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";
  }
Exemple #4
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();
  }
Exemple #5
0
  /** 用户登录 */
  public String doLogin() {
    logger.error("doLogin()...");
    if (getSession().getAttribute(FrontContainer.SELLER_INFO) != null) {
      return "toIndex"; // 登录成功,直接跳转到主页
    }

    if (e.getOwner_mobile() == null
        || e.getOwner_mobile().trim().equals("")
        || e.getPassword() == null
        || e.getPassword().trim().equals("")) {
      errorMsg = "<font color='red'>帐号或密码为空!</font>";
      getSession().setAttribute("errorMsg", errorMsg);
      logger.error("doLogin.errorMsg=" + errorMsg);
      return "toLogin"; // 账号或密码为空,继续登录
    }

    e.setPassword(MD5.md5(e.getPassword()));
    String ownerMobile = e.getOwner_mobile();
    String password = e.getPassword();
    e.clear();

    // 用户验证
    e.setOwner_mobile(ownerMobile);
    e.setPassword(password);
    Seller seller = sellerService.selectOne(e);
    if (seller == null) {
      getSession().setAttribute(FrontContainer.login_errorMsg, errorMsg);
      return "toLogin";
    } else if (seller.getStatus().equals("y")) {
      getSession()
          .setAttribute(
              FrontContainer.login_errorMsg, "<font color='red'>此账号已被冻结!有疑问请联系站点管理员!</font>");
      return "toLogin";
    }

    // 登录成功,设置网页属性
    // seller.setLoginType(LoginTypeEnum.system);//登录方式
    getSession().setAttribute(FrontContainer.SELLER_INFO, seller);

    // 更新用户最后登录时间
    sellerService.updateLoginTime(e);
    // e.clear();
    return "toIndex";
  }
Exemple #6
0
  public String complain() {
    Seller seller = (Seller) getSession().getAttribute(FrontContainer.SELLER_INFO);
    if (seller == null || StringUtils.isBlank(seller.getOwner_mobile())) {
      return "toLogin";
    }

    selectLeftMenu = "complain";
    e = sellerService.selectById(seller.getId());
    setSelectMenu(FrontContainer.not_select_menu); // 设置主菜单为不选中
    return "complainpage";
  }
Exemple #7
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";
  }
Exemple #8
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";
  }
Exemple #9
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";
  }
Exemple #10
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";
  }
Exemple #11
0
  /** 密码修改 */
  public String changePwd() {
    Seller seller = (Seller) getSession().getAttribute(FrontContainer.SELLER_INFO);
    if (seller == null || StringUtils.isBlank(seller.getOwner_mobile())) {
      return "toLogin";
    }

    if (StringUtils.isBlank(e.getNewPassword1())
        || StringUtils.isBlank(e.getNewPassword2())
        || StringUtils.isBlank(e.getPassword())
        || !e.getNewPassword2().equals(e.getNewPassword1())) {
      throw new NullPointerException();
    }
    getSession().setAttribute(FrontContainer.selectMenu, FrontContainer.not_select_menu);
    selectLeftMenu = "password";
    e.setPassword(MD5.md5(e.getNewPassword1()));
    e.setId(seller.getId());
    sellerService.update(e);
    this.errorMsg = "修改密码成功!";
    // 重新缓存密码数据
    seller.setPassword(e.getPassword());

    e.clear();
    return "changePwdSuccess";
  }