Package com.lgx8.management.entities

Examples of com.lgx8.management.entities.Organization


    return getHibernateTemplate().get(GatewayCategory.class, id);
  }

  public String getGatewayCategoryFullName(Integer id) {
    String name = "";
    GatewayCategory cate = this.findGatewayCategoryById(id);
    name = cate.getName();
    if(cate.getParent() != null)
    {
      GatewayCategory pcate = cate.getParent();
      name = getGatewayCategoryFullName(pcate.getId()) + "->" + name;
    }
    return name;
  }
View Full Code Here


      categoryId = "0";
    }else
    {
      Template temp = getConfiguration().getTemplate("listGatewayCategoryDetail.ftl");
     
      GatewayCategory category = gatewayService.findGatewayCategoryById(Integer.parseInt(categoryId));
     
      root.put("category", category);
     
      List<GatewayCategoryDetail> details = gatewayService.findGatewayCategoryDetailByCategoryId(Integer.parseInt(categoryId));
     
View Full Code Here

    String entityName = request.getParameter("entityName");
    String url = request.getParameter("url");
    String layerOrder = request.getParameter("layerOrder");
    if((!"".equals(categoryType)&&categoryType != null) &&("".equals(id)||id == null) && categoryId != null)
    {
      GatewayCategory category = gatewayService.findGatewayCategoryById(Integer.parseInt(categoryId));
     
      if("".equals(areaNode)|| areaNode == null || "null".equals(areaNode))
      {
        areaNode = "";
      }
View Full Code Here

  }

  @Transactional
  public GatewayCategoryDetail saveGatewayCategoryDetail(GatewayCategory category,
      String entityId, String entityUrl,String entityName, String layerOrder, Integer type,String areaNode,String url,String otherUrl) {
    GatewayCategoryDetail detail = new GatewayCategoryDetail();
    detail.setCategory(category);
    detail.setEnabled(true);
    if(!"null".equals(entityId)&&!"".equals(entityId)&&entityId!=null)
      detail.setEntityId(entityId);
    if(!"null".equals(entityUrl)&&!"".equals(entityUrl)&&entityUrl!=null)detail.setEntityUrl(entityUrl);
    if(!"null".equals(otherUrl)&&!"".equals(otherUrl)&&otherUrl!=null)detail.setOtherUrl(otherUrl);
    if(!"null".equals(areaNode)&&!"".equals(areaNode)&&areaNode!=null)detail.setAreaNode(areaNode);
    if(!"null".equals(url)&&!"".equals(url)&&url!=null)detail.setUrl(url);
    if("".equals(layerOrder) || layerOrder == null || "null".equals(layerOrder))
    {
      String hql = "from GatewayCategoryDetail d where d.enabled = true and d.category.id = " + category.getId();
      hql += " order by d.layerOrder desc";
      List<GatewayCategoryDetail> details = getHibernateTemplate().find(hql);
      if(details.size() == 0)
      {
        detail.setLayerOrder("0001");
      }else
      {
        Pattern pattern = Pattern.compile("([0-9]+)*");

        Matcher m = pattern.matcher(details.get(0).getLayerOrder());
        boolean b = m.matches();

        if(b)
        {
          Integer order = Integer.parseInt(details.get(0).getLayerOrder());
          String orderStr = "";
          order ++;
          if(order < 10)
          {
            orderStr = "000"+order;
          }else if(order < 100)
          {
            orderStr = "00"+order;
          }else if(order < 1000)
          {
            orderStr = "0"+order;
          }else
          {
            orderStr = ""+order;
          }
          detail.setLayerOrder(orderStr);
        }else
        {
          detail.setLayerOrder(details.get(0).getLayerOrder()+"1");
        }
      }
    }else
      detail.setLayerOrder(layerOrder);
    detail.setType(type);
    detail.setEntityName(entityName);
   
    getHibernateTemplate().persist(detail);
   
    return detail;
  }
View Full Code Here

  @Transactional
  public GatewayCategoryDetail updateGatewayCategoryDetail(
      Integer categoryId, Integer id, String layerOrder) {
    GatewayCategory category = gatewayCategoryDao.findGatewayCategoryById(categoryId);
    GatewayCategoryDetail detail = getHibernateTemplate().get(GatewayCategoryDetail.class, id);
    detail.setCategory(category);
    detail.setLayerOrder(layerOrder);
    getHibernateTemplate().update(detail);
    return detail;
  }
View Full Code Here

    return detail;
  }

  @Transactional
  public void deleteGatewayCategoryDetail(Integer id) {
    GatewayCategoryDetail detail = getHibernateTemplate().get(GatewayCategoryDetail.class, id);
    getHibernateTemplate().delete(detail);
  }
View Full Code Here

     
      pw.write("1");
    }else if((!"".equals(categoryType)&&categoryType != null) && categoryId != null)
    {
      IGatewayCategoryDetailDao gatewayCategoryDetailDao = (IGatewayCategoryDetailDao) ac.getBean("gatewayCategoryDetailDao");
      GatewayCategoryDetail detail = gatewayCategoryDetailDao.findGatewayCategoryDetailById(Integer.parseInt(id));
      if(!"null".equals(entityId)&&!"".equals(entityId)&&entityId!=null)detail.setEntityId(entityId);
      if(!"null".equals(entityUrl)&&!"".equals(entityUrl)&&entityUrl!=null)detail.setEntityUrl(entityUrl);
      if(!"null".equals(otherUrl)&&!"".equals(otherUrl)&&otherUrl!=null)detail.setOtherUrl(otherUrl);
      if(!"null".equals(areaNode)&&!"".equals(areaNode)&&areaNode!=null)detail.setAreaNode(areaNode);
      if(!"null".equals(url)&&!"".equals(url)&&url!=null)detail.setUrl(url);
      if(!"null".equals(entityName)&&!"".equals(entityName)&&entityName!=null)detail.setEntityName(entityName);
     
      gatewayCategoryDetailDao.updateGatewayCategoryDetail(detail);
    }
   
  }
View Full Code Here

    getHibernateTemplate().persist(op);
  }

  @Transactional
  public void deleteOrderProduct(long id) {
    OrderProduct op = findOrderProduct(id);
    if(op!=null) {
      op.getOrders().getOrderProducts().remove(op);
      getHibernateTemplate().delete(op);
    }
  }
View Full Code Here

  @Transactional
  public Orders findCartByUserId(User user) {
    String hql = "from Orders o where o.status="+Orders.STATUS_CART+" and o.user.id="+user.getId();
    List<Orders> list = getHibernateTemplate().find(hql);
    if(list==null||list.size()==0) {
      Orders o = new Orders();
      //o.setId(System.currentTimeMillis());
      o.setUser(user);
      o.setStatus(Orders.STATUS_CART);
      o.setShoppingtime(new Date());
      createOrders(o);
      return o;
    } else {
      return list.get(0);
    }
View Full Code Here

      lid = Long.parseLong(id);
    } catch (Exception e1) {
      lid = -1;
    }
   
    Product product = gatewayService.findProductById(lid);
    if(product!=null) {
      root.put("product", product);
      root.put("Product_List_Url", Constants.PRODUCT_LIST_URL);
     
      List<Brand> brands = gatewayService.findBrand();
      if(brands!=null&&brands.size()>0) {
        root.put("brands", brands);
      }
     
      List<ProductProperty> colorSelect = gatewayService.findProductPropertyByCategoryId(Constants.PROPERTYCOLOR);
      if(colorSelect!=null&&colorSelect.size()>0) {
        root.put("colorSelect", colorSelect);
      }
     
      List<ProductProperty> coltheSizeSelect = gatewayService.findProductPropertyByCategoryId(Constants.PROPERTYCLOTHESIZE);
      if(coltheSizeSelect!=null&&coltheSizeSelect.size()>0) {
        root.put("coltheSizeSelect", coltheSizeSelect);
      }
     
      List<ProductProperty> shoeSizeSelect = gatewayService.findProductPropertyByCategoryId(Constants.PROPERTYSHOESIZE);
      if(shoeSizeSelect!=null&&shoeSizeSelect.size()>0) {
        root.put("shoeSizeSelect", shoeSizeSelect);
      }
     
      List<FareWay> farewaySelect = gatewayService.findFare();
      if(farewaySelect!=null&&farewaySelect.size()>0) {
        root.put("farewaySelect", farewaySelect);
      }
     
      List<IPObject> iPObjects = gatewayService.findAllIPObject();
      root.put("iPObjects", iPObjects);
     
      String color = product.getColor();
      String[] colors = color.split(";");
      Map<String, String> colorMap = new HashMap<String, String>();
      for(int i=0;i<colors.length;i++) {
        colorMap.put(colors[i], colors[i]);
      }
      root.put("colorMap", colorMap);
     
      String clothesize = product.getClothessize();
      String[] clothesizes = clothesize.split(";");
      Map<String, String> clothesizeMap = new HashMap<String, String>();
      for(int i=0;i<clothesizes.length;i++) {
        clothesizeMap.put(clothesizes[i], clothesizes[i]);
      }
      root.put("clothesizeMap", clothesizeMap);
     
      String shoesize = product.getShoesize();
      String[] shoesizes = shoesize.split(";");
      Map<String, String> shoesizeMap = new HashMap<String, String>();
      for(int i=0;i<shoesizes.length;i++) {
        shoesizeMap.put(shoesizes[i], shoesizes[i]);
      }
      root.put("shoesizeMap", shoesizeMap);
     
      String fareway = product.getFareway();
      String[] fareways = fareway.split(";");
      Map<String, String> farewayMap = new HashMap<String, String>();
      for(int i=0;i<fareways.length;i++) {
        farewayMap.put(fareways[i], fareways[i]);
      }
View Full Code Here

TOP

Related Classes of com.lgx8.management.entities.Organization

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.