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(); }
/** * 批量删除用户 * * @param ids */ public int deletes(String[] ids) { IndexImg e = new IndexImg(); for (int i = 0; i < ids.length; i++) { e.setId(ids[i]); delete(e); } return 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"; }
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"; }
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"; }
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"; }
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"; }