Examples of ProductItem


Examples of com.alibaba.sample.petstore.dal.dataobject.ProductItem

        assertProductItemList(productItemDao.getItemListByProductId("FI-SW-01"), "EST-1", "EST-2");
    }

    @Test
    public void getItemById() {
        ProductItem item = productItemDao.getItemById("EST-1");

        assertEquals("EST-1", item.getProductItemId());
        assertEquals("FI-SW-01", item.getProductId());
        assertEquals(new BigDecimal("16.50"), item.getListPrice());
        assertEquals(new BigDecimal("10.00"), item.getUnitCost());
        assertEquals(1, item.getSupplierId());
        assertEquals("P", item.getStatus());
        assertEquals("Large", item.getAttribute1());
    }
View Full Code Here

Examples of com.alibaba.sample.petstore.dal.dataobject.ProductItem

    public List<ProductItem> getAllProductItems(String productId) {
        return productItemDao.getItemListByProductId(productId);
    }

    public ProductItem getProductItem(String itemId) {
        ProductItem item = productItemDao.getItemById(itemId);

        if (item == null) {
            return null;
        }

        Product product = productDao.getProductById(item.getProductId());
        Category category = categoryDao.getCategoryById(product.getCategoryId());

        product.setCategory(category);
        item.setProduct(product);

        return item;
    }
View Full Code Here

Examples of com.alibaba.sample.petstore.dal.dataobject.ProductItem

        }

        // 依次按catId, productId, productItemId排序
        Collections.sort(cartItems, new Comparator<CartItem>() {
            public int compare(CartItem cartItem1, CartItem cartItem2) {
                ProductItem item1 = cartItem1.getProductItem();
                ProductItem item2 = cartItem2.getProductItem();

                if (item1 == null || item2 == null) {
                    return 0;
                }

                int compare = item1.getProduct().getCategory().getCategoryId()
                                   .compareTo(item2.getProduct().getCategory().getCategoryId());

                if (compare != 0) {
                    return compare;
                }

                compare = item1.getProduct().getProductId().compareTo(item2.getProduct().getProductId());

                if (compare != 0) {
                    return compare;
                }

                return item1.getProductItemId().compareTo(item2.getProductItemId());
            }
        });

        return cart;
    }
View Full Code Here

Examples of com.alibaba.sample.petstore.dal.dataobject.ProductItem

        return getSqlMapClientTemplate().queryForList("getItemListByProduct", productId);
    }

    public ProductItem getItemById(String itemId) {
        Integer i = (Integer) getSqlMapClientTemplate().queryForObject("getInventoryQuantity", itemId);
        ProductItem item = (ProductItem) getSqlMapClientTemplate().queryForObject("getItem", itemId);

        if (item != null && i != null) {
            item.setQuantity(i.intValue());
        }

        return item;
    }
View Full Code Here

Examples of com.alibaba.sample.petstore.dal.dataobject.ProductItem

    @Test
    public void getProductItem() {
        assertNull(storeManager.getProductItem("nonexist"));

        ProductItem item = storeManager.getProductItem("EST-1");
        assertEquals("EST-1", item.getProductItemId());

        Product prod = item.getProduct();
        assertEquals("FI-SW-01", prod.getProductId());
        assertEquals("Angelfish", prod.getName());

        Category cat = prod.getCategory();
        assertEquals("FISH", cat.getCategoryId());
View Full Code Here

Examples of lineage2.gameserver.model.ProductItem

              Node startTimeNode = d1.getAttributes().getNamedItem("sale_start_date");
              long startTimeSale = startTimeNode != null ? getMillisecondsFromString(startTimeNode.getNodeValue()) : 0;
              Node endTimeNode = d1.getAttributes().getNamedItem("sale_end_date");
              long endTimeSale = endTimeNode != null ? getMillisecondsFromString(endTimeNode.getNodeValue()) : 0;
              ArrayList<ProductItemComponent> components = new ArrayList<>();
              ProductItem pr = new ProductItem(productId, category, price, tabId, startTimeSale, endTimeSale);
              for (Node t1 = d1.getFirstChild(); t1 != null; t1 = t1.getNextSibling())
              {
                if ("component".equalsIgnoreCase(t1.getNodeName()))
                {
                  int item_id = Integer.parseInt(t1.getAttributes().getNamedItem("item_id").getNodeValue());
                  int count = Integer.parseInt(t1.getAttributes().getNamedItem("count").getNodeValue());
                  ProductItemComponent component = new ProductItemComponent(item_id, count);
                  components.add(component);
                }
              }
              pr.setComponents(components);
              _itemsList.put(productId, pr);
            }
          }
        }
      }
View Full Code Here

Examples of org.jclouds.softlayer.domain.ProductItem

      Iterable<String> hardwareIds = Splitter.on(",").split(template.getHardware().getId());
      for (String hardwareId : hardwareIds) {
         int id = Integer.parseInt(hardwareId);
         result.add(ProductItemPrice.builder().id(id).build());
      }
      ProductItem uplinkItem = find(productPackageSupplier.get().getItems(),
            and(capacity(portSpeed), categoryCode("port_speed")));
      result.add(get(uplinkItem.getPrices(), 0));
      result.addAll(prices);
      return result.build();
   }
View Full Code Here

Examples of org.jclouds.softlayer.domain.ProductItem

   }

   @Override
   public Hardware apply(Iterable<ProductItem> items) {

      ProductItem coresItem = getOnlyElement(filter(items, matches(cpuDescriptionRegex)));
      ProductItem ramItem = getOnlyElement(filter(items, categoryCode(RAM_CATEGORY)));
      ProductItem volumeItem = get(filter(items, categoryCode(FIRST_GUEST_DISK)), 0);

      String hardwareId = hardwareId().apply(ImmutableList.of(coresItem, ramItem, volumeItem));
      double cores = ProductItems.capacity().apply(coresItem).doubleValue();
      Matcher cpuMatcher = cpuDescriptionRegex.matcher(coresItem.getDescription());
      double coreSpeed = (cpuMatcher.matches()) ? Double.parseDouble(cpuMatcher.group(cpuMatcher.groupCount())) : DEFAULT_CORE_SPEED;
View Full Code Here

Examples of org.jclouds.softlayer.domain.ProductItem

            return null;
         ProductOrder order = client.getVirtualGuestClient().getOrderTemplate(guest.getId());
         if (order == null)
            return null;
         Iterable<ProductItem> items = Iterables.transform(order.getPrices(), ProductItems.item());
         ProductItem os = Iterables.find(items, ProductItemPredicates.categoryCode("os"));
         return new ProductItemToImage().apply(os);
      }
View Full Code Here

Examples of org.jclouds.softlayer.domain.ProductItem

   @Test
   public void testConversion() {
      for( String description : operatingSystems )
      {
         ProductItem item = ProductItem.builder()
                                       .description(description)
                                       .prices(ProductItemPrice.builder().id(1234).build())
                                       .build();
         Image i = new ProductItemToImage().apply(item);
         OperatingSystem os = i.getOperatingSystem();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.