Package com.lgx8.gateway.entities

Examples of com.lgx8.gateway.entities.Supplier


  }

  @Transactional
  public void deleteProductPropertyCategory(Long id)
  {
    ProductPropertyCategory category = findProductPropertyCategoryById(id);
    category.setEnabled(false);
    getHibernateTemplate().update(category);
//    getHibernateTemplate().delete(findProductPropertyCategoryById(id));
  }
View Full Code Here


    List<ProductPropertyCategory> categorys = getHibernateTemplate().find(hql);
    return categorys;
  }

  public ProductPropertyCategory findProductPropertyCategoryById(Long id) {
    ProductPropertyCategory category = getHibernateTemplate().get(ProductPropertyCategory.class, id);
    return category;
  }
View Full Code Here

    return info;
  }

  @Transactional
  public ShoppingInfo updateShoppingInfo(Long id, Boolean isUsed) {
    ShoppingInfo info = this.getHibernateTemplate().get(ShoppingInfo.class, id);
    if(info != null)
    {
      info.setIsUsed(isUsed);
      this.getHibernateTemplate().update(info);
    }
    return info;
  }
View Full Code Here

      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

        out.flush();
        return;
      }
     
     
      Supplier supplier = new Supplier();
      supplier.setName(name);
      supplier.setDescription(description);
      supplier.setBusinessNum(businessNum);
      supplier.setLegalPerson(legalPerson);
      supplier.setMobile(mobile);
      supplier.setEmail(email);
      supplier.setQq(qq);
      supplier.setWangwang(wangwang);
      supplier.setAddress(address);
      supplier.setIsproduct(isProduct);
     
     
     
     
      gatewayService.createSupplier(supplier);
     
     
      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");
     
      Supplier supplier = gatewayService.findSupplier(lid);
      if(supplier==null) {
        out.print("({'result':'0','msg':'修改的供应商信息不存在!'})");
        out.flush();
        return;
      }
     
      String name = request.getParameter("name");
      /*if(gatewayService.checkSupplierNameExists(name)) {
        out.print("({'result':'0','msg':'供应商名称已存在!'})");
        out.flush();
        return;
      }*/
     
      String description = request.getParameter("description");
      String businessNum = request.getParameter("businessNum");
      String legalPerson = request.getParameter("legalPerson");
      String mobile = request.getParameter("mobile");
      String email = request.getParameter("email");
      String qq = request.getParameter("qq");
      String wangwang = request.getParameter("wangwang");
      String address = request.getParameter("address");
      String isproduct = request.getParameter("isproduct");
      int isProduct = 1;
      if("0".equals(isproduct)) {
        isProduct = 0;
      }
     
      if(name==null||"".equals(name)) {
        out.print("({'result':'0','msg':'供应商名称不能为空!'})");
        out.flush();
        return;
      }
     
     
      supplier.setName(name);
      supplier.setDescription(description);
      supplier.setBusinessNum(businessNum);
      supplier.setLegalPerson(legalPerson);
      supplier.setMobile(mobile);
      supplier.setEmail(email);
      supplier.setQq(qq);
      supplier.setWangwang(wangwang);
      supplier.setAddress(address);
      supplier.setIsproduct(isProduct);
     
      gatewayService.updateSupplier(supplier);
     
      out.print("({'result':'1','msg':'修改供应商信息成功!'})");
      out.flush();
View Full Code Here

      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;
      }
View Full Code Here

          list.get(i).statusToString()
      });
      mapList.add(cellMap);
    }
    pageInfo.put("rows", mapList);
    JSONObject object = new JSONObject(pageInfo);
    jsonStr = object.toString();
    return jsonStr;
  }
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {
    ApplicationContext ac = new ClassPathXmlApplicationContext("ApplicationContext.xml");
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
   
    List<Category> categorys = gatewayService.findAllCategory();
    System.out.println(categorys.get(0).getChilds());
   
    /*AreaCategory areaCategory = new AreaCategory();
    areaCategory.setName("共享良品");
    areaCategory.setDescription("共享良品");
View Full Code Here

    } catch (Exception e) {
      lbrandid = -1;
    }
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
 
    PageList page = null;
    if("all".equals(areacategoryid)&&"all".equals(categoryid)&&"all".equals(brandid)) {
     
    } else if("all".equals(areacategoryid)&&"all".equals(categoryid)) {
      //查商品
      if("1".equals(type)) {
        page = gatewayService.findProduct(keys, pagenum, Constants.SEARCH_RESULT_PAGE_SIZE, orderStr);
      //查品牌
      } else {
        if(brandid!=null&&!"".equals(brandid)&&lbrandid!=-1) {
          page = gatewayService.findProductByBrand(lbrandid, pagenum, Constants.SEARCH_RESULT_PAGE_SIZE, orderStr);
        } else {
          page = gatewayService.findProductByBrand(keys, pagenum, Constants.SEARCH_RESULT_PAGE_SIZE, orderStr);
        }
      }
      //查询指定商品分类下面所有分区商品
    } else if("all".equals(areacategoryid)&&categoryid!=null) {
      page = gatewayService.findProduct(new Long(categoryid), keys, pagenum, Constants.SEARCH_RESULT_PAGE_SIZE, orderStr);
      //查询指定分区下面所有商品分类
    } else if("all".equals(categoryid)&&areacategoryid!=null) {
      page = gatewayService.findProductAllCategory(new Long(areacategoryid), keys, pagenum, Constants.SEARCH_RESULT_PAGE_SIZE, orderStr);
    } else if(categoryid!=null&&areacategoryid!=null) {
      page = gatewayService.findProduct(new Long(areacategoryid), new Long(categoryid), keys, pagenum, Constants.SEARCH_RESULT_PAGE_SIZE, orderStr);
    }
     
   
   
   
    Template temp = null;
   
    //TODO 假数据
    List<Product> lastWeekHotProduct = gatewayService.findLastWeekHotProduct(Constants.LAST_WEEK_HOT_PRODUCT_SIZE);
    if(lastWeekHotProduct!=null) {
      root.put("lastWeekHotProduct", lastWeekHotProduct);
    }
   
    //TODO 猜你喜欢的商品,先做假数据
View Full Code Here

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

TOP

Related Classes of com.lgx8.gateway.entities.Supplier

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.