コード例 #1
0
 protected Integer calcTotalUnitCount(final AbstractOrderModel source) {
   int totalUnitCount = 0;
   for (final AbstractOrderEntryModel orderEntryModel : source.getEntries()) {
     totalUnitCount += orderEntryModel.getQuantity().intValue();
   }
   return Integer.valueOf(totalUnitCount);
 }
コード例 #2
0
  protected double getProductsDiscountsAmount(final AbstractOrderModel source) {
    double discounts = 0.0d;

    final List<AbstractOrderEntryModel> entries = source.getEntries();
    if (entries != null) {
      for (final AbstractOrderEntryModel entry : entries) {
        final List<DiscountValue> discountValues = entry.getDiscountValues();
        if (discountValues != null) {
          for (final DiscountValue dValue : discountValues) {
            discounts += dValue.getAppliedValue();
          }
        }
      }
    }
    return discounts;
  }
コード例 #3
0
 protected void addEntries(final AbstractOrderModel source, final AbstractOrderData prototype) {
   prototype.setEntries(Converters.convertAll(source.getEntries(), getOrderEntryConverter()));
 }
コード例 #4
0
 protected Integer calcTotalItems(final AbstractOrderModel source) {
   return Integer.valueOf(source.getEntries().size());
 }