Package com.lgx8.gateway.service

Examples of com.lgx8.gateway.service.IGatewayService


    Map<Object, Object> root = new HashMap<Object, Object>();
    root.putAll(super.root);
    Template temp = getConfiguration().getTemplate("brand/BrandDetail.ftl");
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
   
    String id = request.getParameter("id");
    long lid = -1;
    try {
      lid = Long.parseLong(id);
    } catch (Exception e1) {
      lid = -1;
    }
   
    Brand brand = gatewayService.findBrandById(lid);
    if(brand!=null) {
      root.put("brand", brand);
      root.put("Brand_List_Url", Constants.BRAND_LIST_URL);
    }
   
    List<Supplier> suppliers = gatewayService.findSupplier();
    if(suppliers!=null&&suppliers.size()>0) {
      root.put("suppliers", suppliers);
    }
   
    /* 将模板和数据模型合并 */
 
View Full Code Here


                      path = sourcePath.split("\\"+System.getProperty("file.separator"));
                      sourcePath = path[path.length-3]+"/"+ path[path.length-2]+"/"+ path[path.length-1];
                      productImage.setLargeURL(sourcePath);
                     
                      ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
                      IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
                      gatewayService.createProductImage(productImage);
                     
                      GatewayConfig gatewayConfig = (GatewayConfig) getServletContext().getAttribute("gatewayConfig");
                     
                      PrintWriter out = response.getWriter();
                      out.println("<script type=\"text/javascript\">");
View Full Code Here

   */
  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    Map<Object, Object> root = new HashMap<Object, Object>();
    root.putAll(super.root);
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
   
    String type = request.getParameter("type");
   
    if(type == null || "".equals(type) ||"null".equals(type)||"0".equals(type))
    {
      List<Product> products = gatewayService.findAllProductByAreaCategoryId(Long.parseLong(type));
     
      Template temp = getConfiguration().getTemplate("listProduct.ftl");
     
      root.put("products", products);
     
      /* 将模板和数据模型合并 */
      Writer out = response.getWriter();
      try {
        temp.process(root, out);
      } catch (TemplateException e) {
        e.printStackTrace();
      }
      out.flush();
    }else
    {
      List<Brand> brands = gatewayService.findAllBrand();
     
      Template temp = getConfiguration().getTemplate("listBrand.ftl");
     
      root.put("brands", brands);
     
View Full Code Here

  /**
   * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
   */
  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
    Product product = new Product();
   
    String name = request.getParameter("name");
    product.setName(name);
   
    String areaNode = request.getParameter("areaNode");
    product.setAreaNode(areaNode);
   
    String code = request.getParameter("code");
    product.setCode(code);
   
    String weight = request.getParameter("weight");
    product.setWeight(Double.parseDouble(weight));
   
    String productImageId = request.getParameter("productImageId");
    ProductImage image = null;
    if(productImageId!=null) {
      try {
        image = gatewayService.findProductImage(new Long(productImageId));
      } catch (Exception e) {
        image = null;
      }
    }
    if(image!=null) {
      product.setImage(image);
    }
    String price = request.getParameter("price");
    double pprice = 0;
    try {
      pprice = new Double(price);
    } catch (Exception e) {
      pprice = 0;
    }
    product.setPrice(pprice);
   
    String leaves = request.getParameter("leaves");
    int pleaves = 0;
    try {
      pleaves = new Integer(leaves);
    } catch (Exception e) {
      pleaves = 0;
    }
    product.setLeaves(pleaves);
   
    String onsale = request.getParameter("onsale");
    if("1".equals(onsale)) {
      product.setOnsale(1);
    } else {
      product.setOnsale(0);
    }
   
    String areaCategoryId = request.getParameter("areaCategoryId");
    AreaCategory areaCategory = null;
    try {
      areaCategory = gatewayService.findAreaCategory(new Long(areaCategoryId));
    } catch (Exception e) {
      areaCategory = null;
    }
    if(areaCategory!=null) {
      product.setAreaCategory(areaCategory);
    }
   
    String categoryId = request.getParameter("categoryId");
    Category category = null;
    try {
      category = gatewayService.findCategory(new Long(categoryId));
    } catch (Exception e) {
      category = null;
    }
    product.setCategory(category);
   
    String description = request.getParameter("description");
    product.setDescription(description);
   
    gatewayService.createProduct(product);
   
    PrintWriter out = response.getWriter();
    out.print("1");
    out.flush();
    out.close();
View Full Code Here

    root.putAll(super.root);
   
    Template temp = getConfiguration().getTemplate("imageList.ftl");
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
   
    List<ProductImage> productImages = gatewayService.findProductImageListOrderByTime("desc");
   
    if(productImages!=null&&productImages.size()>0) {
      root.put("productImages", productImages);
    }
   
View Full Code Here

    Map<Object, Object> root = new HashMap<Object, Object>();
    root.putAll(super.root);
    Template temp = getConfiguration().getTemplate("supplier/SupplierDetail.ftl");
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
   
    String id = request.getParameter("id");
    long lid = -1;
    try {
      lid = Long.parseLong(id);
    } catch (Exception e1) {
      lid = -1;
    }
   
    Supplier supplier = gatewayService.findSupplier(lid);
   
    if(supplier!=null) {
      root.put("supplier", supplier);
      root.put("Supplier_List_Url", Constants.SUPPLIER_LIST_URL);
    }
View Full Code Here

    root.putAll(base);
   
    Template temp = getConfiguration().getTemplate("adviseproductlist.ftl");
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
   
    //奢品模块品牌
    List<ProductVO> productVOs = gatewayService.initGatewayInfo(GatewayConstants.CSP_SPMK11);
    root.put("productVOs", productVOs);
   
    String pageno = request.getParameter("pageno");
   
    String brandid = request.getParameter("brandid");
   
    if(StringUtil.isEmptyStr(brandid))
    {
      brandid = "0";
      if(productVOs.size() != 0)
      {
        brandid = productVOs.get(0).getEntityId();
      }
    }

    //处理当前页
    if(pageno==null) {
      pageno = "1";
    }
    int pagenum = 1;
    try {
      pagenum = Integer.parseInt(pageno);
    } catch (Exception e1) {
      pagenum = 1;
    }   
   
    PageList pageList = null;
   
    pageList = gatewayService.findProductByBrandConditions(4l, Long.valueOf(brandid), "", "",null,pagenum+"",null);
   
    if(pageList!=null&&pageList.getDataList()!=null)
    {
      root.put("pageList", pageList);
    }
View Full Code Here

      category.setSendMsg(sendMsg);
      categoryDao.updateCategory(category);
    }
   
   
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
    //更新ServletContext中的目录列表
    @SuppressWarnings("unchecked")
    List<Category> categorys = (List<Category>) getServletContext().getAttribute("categorys");
    categorys.clear();
    categorys.addAll(gatewayService.findAllCategory());
   
    Map<Long, Category> categoryMap = new HashMap<Long, Category>();
    GatewayIndexListen.addCategoryToMap(categorys, categoryMap);
    getServletContext().setAttribute("categoryMap", categoryMap);
   
View Full Code Here

    response.setCharacterEncoding("UTF-8");
   
    String id = request.getParameter("categoryId");
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
   
    gatewayService.deleteProductPropertyCategory(Long.parseLong(id));
   
    pw.write("1");
  }
View Full Code Here

    root.putAll(base);
   
    Template temp = getConfiguration().getTemplate("adviseproduct2.ftl");
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
   
    //奢品模块二
    List<ProductVO> productVOs = gatewayService.initGatewayInfo(GatewayConstants.CSP_SPMK2);
    root.put("productVOs", productVOs);
   
    /* 将模板和数据模型合并 */
    Writer out = response.getWriter();
    try {
View Full Code Here

TOP

Related Classes of com.lgx8.gateway.service.IGatewayService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.