Package org.ofbiz.entity

Examples of org.ofbiz.entity.GenericDelegator.findByAndCache()


                    List variantProductPrices = null;
                    String variantProductId = null;
                    while (variantAssocIter.hasNext()) {
                        GenericValue variantAssoc = (GenericValue) variantAssocIter.next();
                        String curVariantProductId = variantAssoc.getString("productIdTo");
                        List curVariantPriceList = EntityUtil.filterByDate(delegator.findByAndCache("ProductPrice", UtilMisc.toMap("productId", curVariantProductId), UtilMisc.toList("-fromDate")), nowTimestamp);
                        List tempDefaultPriceList = EntityUtil.filterByAnd(curVariantPriceList, UtilMisc.toMap("productPriceTypeId", "DEFAULT_PRICE"));
                        GenericValue curDefaultPriceValue = EntityUtil.getFirst(tempDefaultPriceList);
                        if (curDefaultPriceValue != null) {
                            Double curDefaultPrice = curDefaultPriceValue.getDouble("price");
                            if (curDefaultPrice.doubleValue() < minDefaultPrice) {
View Full Code Here


                    quantityProductPriceRules = FastList.newInstance();
                    nonQuantityProductPriceRules = FastList.newInstance();
                    Iterator productPriceRulesIter = allProductPriceRules.iterator();
                    while (productPriceRulesIter.hasNext()) {
                        GenericValue productPriceRule = (GenericValue) productPriceRulesIter.next();
                        List productPriceCondList = delegator.findByAndCache("ProductPriceCond", UtilMisc.toMap("productPriceRuleId", productPriceRule.get("productPriceRuleId")));
                       
                        boolean foundQuantityInputParam = false;
                        // only consider a rule if all conditions except the quantity condition are true
                        boolean allExceptQuantTrue = true;
                        Iterator productPriceCondIter = productPriceCondList.iterator();
View Full Code Here

        Set featureSet = new LinkedHashSet();

        try {
            Map fields = UtilMisc.toMap("productId", productId, "productFeatureApplTypeId", "SELECTABLE_FEATURE");
            List order = UtilMisc.toList("sequenceNum", "productFeatureTypeId");
            List features = delegator.findByAndCache("ProductFeatureAndAppl", fields, order);
            Iterator i = features.iterator();
            while (i.hasNext()) {
                featureSet.add(((GenericValue) i.next()).getString("productFeatureTypeId"));
            }
            //if (Debug.infoOn()) Debug.logInfo("" + featureSet, module);
View Full Code Here

        List selectableFeatures = null;
        try {
            Map fields = UtilMisc.toMap("productId", productId, "productFeatureApplTypeId", "SELECTABLE_FEATURE");
            List sort = UtilMisc.toList("sequenceNum");

            selectableFeatures = delegator.findByAndCache("ProductFeatureAndAppl", fields, sort);
            selectableFeatures = EntityUtil.filterByDate(selectableFeatures, true);
        } catch (GenericEntityException e) {
            Debug.logError(e, module);
            return ServiceUtil.returnError(UtilProperties.getMessage(resource,"productservices.empty_list_of_selectable_features_found", locale));
        }
View Full Code Here

            Map fields = UtilMisc.toMap("productId", productId);
            List order = UtilMisc.toList("sequenceNum", "productFeatureTypeId");

            if (distinct != null) fields.put("productFeatureTypeId", distinct);
            if (type != null) fields.put("productFeatureApplTypeId", type);
            features = delegator.findByAndCache("ProductFeatureAndAppl", fields, order);
            result.put("productFeatures", features);
            result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
        } catch (GenericEntityException e) {
            Map messageMap = UtilMisc.toMap("errMessage", e.toString());
            errMsg = UtilProperties.getMessage(resource,"productservices.problem_reading_product_feature_entity", messageMap, locale);
View Full Code Here

        // get the productFeature type TYPE (VL promo code)
        GenericValue typeFeature = null;
        try {
            Map fields = UtilMisc.toMap("productId", product.get("productId"), "productFeatureTypeId", "TYPE");
            List order = UtilMisc.toList("-fromDate");
            List featureAppls = delegator.findByAndCache("ProductFeatureAndAppl", fields, order);
            featureAppls = EntityUtil.filterByDate(featureAppls);
            typeFeature = EntityUtil.getFirst(featureAppls);
        } catch (GenericEntityException e) {
            Debug.logError(e, module);
            return ServiceUtil.returnError("Unable to get the required feature type TYPE from Product");
View Full Code Here

        Iterator shipmentPlansIt = shipmentPlans.iterator();
        while (shipmentPlansIt.hasNext()) {
            GenericValue shipmentPlan = (GenericValue)shipmentPlansIt.next();
            GenericValue orderItem = shipmentPlan.getRelatedOne("OrderItem");
   
            List productionRuns = delegator.findByAndCache("WorkOrderItemFulfillment", UtilMisc.toMap("orderId", shipmentPlan.getString("orderId"), "orderItemSeqId", shipmentPlan.getString("orderItemSeqId")));
            if (productionRuns != null && productionRuns.size() > 0) {
                Debug.logError("Production Run for order item (" + orderItem.getString("orderId") + "/" + orderItem.getString("orderItemSeqId") + ") not created.", module);
                continue;
            }
            Map result = dispatcher.runSync("createProductionRunsForOrder", UtilMisc.<String, Object>toMap("quantity", shipmentPlan.getDouble("quantity"), "orderId", shipmentPlan.getString("orderId"), "orderItemSeqId", shipmentPlan.getString("orderItemSeqId"), "shipmentId", shipmentId, "userLogin", userLogin));
View Full Code Here

          Iterator<String> featureIter = selectedFeatures.iterator();         
          while (featureIter.hasNext()) {
            String paramValue = featureIter.next();
            // find incompatibilities..
            List<GenericValue> incompatibilityVariants = delegator.findByAndCache("ProductFeatureIactn", UtilMisc.toMap("productId", productId,
                "productFeatureIactnTypeId","FEATURE_IACTN_INCOMP"));
            Iterator<GenericValue> incompIter = incompatibilityVariants.iterator()
            while (incompIter.hasNext()) {
              GenericValue incompatibilityVariant = incompIter.next();
              String featur = incompatibilityVariant.getString("productFeatureId");
View Full Code Here

                }

              }
            }
            // find dependencies..
            List<GenericValue> dependenciesVariants = delegator.findByAndCache("ProductFeatureIactn", UtilMisc.toMap("productId", productId,
                "productFeatureIactnTypeId","FEATURE_IACTN_DEPEND"));
            Iterator<GenericValue> dpIter = dependenciesVariants.iterator()
            while (dpIter.hasNext()) {
              GenericValue dpVariant = dpIter.next();
              String featur = dpVariant.getString("productFeatureId");
View Full Code Here

  nextProd:    while(assocIter.hasNext()) {
            GenericValue productAssoc = (GenericValue) assocIter.next();
            Iterator <String> fIter = selectedFeatures.iterator();
            while (fIter.hasNext()) {
              String featureId = (String) fIter.next();
              List <GenericValue> pAppls = delegator.findByAndCache("ProductFeatureAppl", UtilMisc.toMap("productId", productAssoc.getString("productIdTo"), "productFeatureId", featureId, "productFeatureApplTypeId","STANDARD_FEATURE"));
              if (UtilValidate.isEmpty(pAppls)) {
                continue nextProd;
              }
            }
            productFound = true;
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.