Package com.lgx8.gateway.service

Examples of com.lgx8.gateway.service.IGatewayService


  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");
   
    List<ProductPropertyCategory>  propertyCategorys= gatewayService.findAllProductPropertyCategorys();
   
    Template temp = getConfiguration().getTemplate("listProductPropertyCategory.ftl");
   
    root.put("propertyCategorys", propertyCategorys);
   
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 categoryId = request.getParameter("categoryId");
   
    if(categoryId == null || "".equals(categoryId) || "null".equals(categoryId))
    {
      categoryId = "0";
    }
   
    List<ProductProperty>  productPropertys= (List<ProductProperty>) gatewayService.findProductPropertyByCategoryId(Long.parseLong(categoryId));
   
    List<ProductPropertyCategory>  propertyCategorys= gatewayService.findAllProductPropertyCategorys();
   
    root.put("propertyCategorys", propertyCategorys);
   
    Template temp = getConfiguration().getTemplate("listProductProperty.ftl");
   
View Full Code Here

    String id = request.getParameter("ppid");
    String value = request.getParameter("pvalue");
   
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
   
    if("0".equals(id))
    {
      gatewayService.createProductProperty(Long.parseLong(categoryId), value);
    }else
    {
      ProductProperty property = gatewayService.findProductPropertyById(Long.parseLong(id));
      property.setValue(value);
      ProductPropertyCategory category = gatewayService.findProductPropertyCategoryById(Long.parseLong(categoryId));
      property.setCategory(category);
     
      gatewayService.updateProductProperty(property);
    }
   
   
    pw.write("1");
  }
View Full Code Here

   
    String name = request.getParameter("pname");
    String categoryId = request.getParameter("pid");
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
   
    if("0".equals(categoryId)||categoryId == null)
    {
      gatewayService.createProductPropertyCategory(name);
    }else
    {
      ProductPropertyCategory category = gatewayService.findProductPropertyCategoryById(Long.parseLong(categoryId));
      category.setName(name);
      gatewayService.updateProductPropertyCategory(category);
    }
   
   
   
    pw.write("1");
View Full Code Here

    Map<Object, Object> root = new HashMap<Object, Object>();
    root.putAll(super.root);
    Template temp = getConfiguration().getTemplate("brand/AddBrand.ftl");
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
   
    List<Supplier> suppliers = gatewayService.findSupplier();
   
    if(suppliers!=null&&suppliers.size()>0) {
      root.put("suppliers", suppliers);
    }
   
View Full Code Here

    response.setCharacterEncoding("UTF-8");
   
    String areaName = Escape.unescape(request.getParameter("areaName")).trim();

    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
   
    IPObject iPObject = gatewayService.findIPObjectByAreaName(areaName);
   
    if(iPObject != null)
    {
      request.getSession().setAttribute("iPObject", iPObject);
    }else
    {
      iPObject = gatewayService.findIPObjectByAreaName("长沙市");
      request.getSession().setAttribute("iPObject", iPObject);
     
      areaName = "长沙市";
    }
   
View Full Code Here

      brand.setName(name);
      brand.setDescription(description);
      brand.setImageUrl(imageUrl);
     
      ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
      IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
     
      long lsupplierid = -1;
      try {
        lsupplierid = Long.parseLong(supplierid);
      } catch (Exception e) {
        lsupplierid = -1;
      }
      Supplier supplier = gatewayService.findSupplier(lsupplierid);
      if(supplier==null) {
        out.print("({'result':'0','msg':'添加失败,未找到对应的供应商!'})");
        out.flush();
        return;
      }
     
      if(gatewayService.chechBrandNameExsits(name)) {
        out.print("({'result':'0','msg':'添加失败,品牌名称已存在!'})");
        out.flush();
        return;
      }
     
     
      brand.setSupplier(supplier);
     
      gatewayService.createBrand(brand);
     
     
      out.print("({'result':'1','msg':'成功添加品牌!'})");
      out.flush();
      return;
    } else if("2".equals(operation)) {
      String id = request.getParameter("id");
     
      long lid = -1;
      try {
        lid = Long.parseLong(id);
      } catch (Exception e) {
        lid = -1;
      }
      ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
      IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
     
      Brand brand = gatewayService.findBrandById(lid);
      if(brand==null) {
        out.print("({'result':'0','msg':'修改的品牌信息不存在!'})");
        out.flush();
        return;
      }
      String name = request.getParameter("name");
     
      /*if(gatewayService.chechBrandNameExsits(name)) {
        out.print("({'result':'0','msg':'修改失败,品牌名称已存在!'})");
        out.flush();
        return;
      }*/
     
     
      String description = request.getParameter("description");
      String imageUrl = request.getParameter("imageUrl");
      String supplierid = request.getParameter("supplierid");
     
      brand.setName(name);
      brand.setDescription(description);
      brand.setImageUrl(imageUrl);
     
     
      long lsupplierid = -1;
      try {
        lsupplierid = Long.parseLong(supplierid);
      } catch (Exception e) {
        lsupplierid = -1;
      }
      Supplier supplier = gatewayService.findSupplier(lsupplierid);
      if(supplier==null) {
        out.print("({'result':'0','msg':'修改失败,未找到对应的供应商!'})");
        out.flush();
        return;
      }
      brand.setSupplier(supplier);
     
     
      gatewayService.updateBrand(brand);
     
      out.print("({'result':'1','msg':'修改品牌信息成功!'})");
      out.flush();
      return;
    } else if("3".equals(operation)) {
      String id = request.getParameter("id");
     
      long lid = -1;
      try {
        lid = Long.parseLong(id);
      } catch (Exception e) {
        lid = -1;
      }
      ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
      IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
     
      gatewayService.deleteBrand(lid);
     
      request.getRequestDispatcher("page/gateway/admin/brand/BrandList.jsp").forward(request, response);
    }
  }
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");
   
    String id = request.getParameter("id");
   
    gatewayService.deleteGatewayCategoryDetail(Integer.parseInt(id));
   
    PrintWriter pw = response.getWriter();
   
    pw.write("1");
  }
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {
    User user = new User();
    user.setUsername("czt");
    user.setPassword("czt");
    user.setEmail("www15119258@qq.com");
    user.setRegistertime(new Date());
    user.setLastlogin(new Date());
    user.setNickname("苍之涛");
    user.setTruename("李晖");
    user.setSex(User.SEX_NULL);
    user.setIp("127.0.0.1");
    user.setMobile("15015531354");
   
   
    ApplicationContext ac = new ClassPathXmlApplicationContext("ApplicationContext.xml");
   
    IUserCardService userCardService = (IUserCardService) ac.getBean("userCardService");
//    userCardService.createUser(user);
//   
    user = userCardService.findUser("username", "czt");
   
    System.out.println(user.getCard().getScore());
   
//    IConfigDao dao = (IConfigDao) ac.getBean("configDao");
//    System.out.println(dao.findGatewayConfig());
   
  }
View Full Code Here

    user.setMobile("15015531354");
   
   
    ApplicationContext ac = new ClassPathXmlApplicationContext("ApplicationContext.xml");
   
    IUserCardService userCardService = (IUserCardService) ac.getBean("userCardService");
//    userCardService.createUser(user);
//   
    user = userCardService.findUser("username", "czt");
   
    System.out.println(user.getCard().getScore());
   
//    IConfigDao dao = (IConfigDao) ac.getBean("configDao");
//    System.out.println(dao.findGatewayConfig());
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.