svn commit: r1787917 - in /ofbiz/branches/release16.11: ./ applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1787917 - in /ofbiz/branches/release16.11: ./ applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java

jleroux@apache.org
Author: jleroux
Date: Tue Mar 21 09:20:49 2017
New Revision: 1787917

URL: http://svn.apache.org/viewvc?rev=1787917&view=rev
Log:
"Applied fix from trunk framework for revision: 1787910"
------------------------------------------------------------------------
r1787910 | jleroux | 2017-03-21 09:58:40 +0100 (mar. 21 mars 2017) | 1 ligne

No functional changes, removes 2 useless swallowed exceptions, refactors
------------------------------------------------------------------------


Modified:
    ofbiz/branches/release16.11/   (props changed)
    ofbiz/branches/release16.11/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java

Propchange: ofbiz/branches/release16.11/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 21 09:20:49 2017
@@ -10,5 +10,5 @@
 /ofbiz/branches/json-integration-refactoring:1634077-1635900
 /ofbiz/branches/multitenant20100310:921280-927264
 /ofbiz/branches/release13.07:1547657
-/ofbiz/ofbiz-framework/trunk:1783202,1783388,1784549,1784558,1784708,1785882,1785925,1786079,1786214,1786525,1787047,1787133,1787176,1787535,1787627,1787823,1787906-1787909
+/ofbiz/ofbiz-framework/trunk:1783202,1783388,1784549,1784558,1784708,1785882,1785925,1786079,1786214,1786525,1787047,1787133,1787176,1787535,1787627,1787823,1787906-1787910
 /ofbiz/trunk:1770481,1770490,1770540,1771440,1771448,1771516,1771935,1772346,1772880,1774772,1775441,1779724,1780659,1781109,1781125,1781979,1782498,1782520

Modified: ofbiz/branches/release16.11/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release16.11/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java?rev=1787917&r1=1787916&r2=1787917&view=diff
==============================================================================
--- ofbiz/branches/release16.11/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java (original)
+++ ofbiz/branches/release16.11/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java Tue Mar 21 09:20:49 2017
@@ -257,55 +257,46 @@ public class MrpServices {
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingMrpEventFindError", locale));
         }
         for (GenericValue genericResult : resultList) {
-            String newOrderId =  genericResult.getString("orderId");
-            if (!newOrderId.equals(orderId)) {
-                orderDeliverySchedule = null;
-                orderId = newOrderId;
-                try {
+            try {
+                String newOrderId =  genericResult.getString("orderId");
+                if (!newOrderId.equals(orderId)) {
+                    orderDeliverySchedule = null;
+                    orderId = newOrderId;
                     orderDeliverySchedule = EntityQuery.use(delegator).from("OrderDeliverySchedule").where("orderId", orderId, "orderItemSeqId", "_NA_").queryOne();
-                } catch (GenericEntityException e) {
                 }
-            }
-            String productId =  genericResult.getString("productId");
-
-            BigDecimal shipGroupQuantity = genericResult.getBigDecimal("quantity");
-            BigDecimal cancelledQuantity = genericResult.getBigDecimal("cancelQuantity");
-            if (UtilValidate.isEmpty(shipGroupQuantity)) {
-                shipGroupQuantity = BigDecimal.ZERO;
-            }
-            if (UtilValidate.isNotEmpty(cancelledQuantity)) {
-                shipGroupQuantity = shipGroupQuantity.subtract(cancelledQuantity);
-            }
-
-            OrderReadHelper orh = new OrderReadHelper(delegator, orderId);
-            BigDecimal shippedQuantity = null;
-            try {
+                String productId =  genericResult.getString("productId");
+    
+                BigDecimal shipGroupQuantity = genericResult.getBigDecimal("quantity");
+                BigDecimal cancelledQuantity = genericResult.getBigDecimal("cancelQuantity");
+                if (UtilValidate.isEmpty(shipGroupQuantity)) {
+                    shipGroupQuantity = BigDecimal.ZERO;
+                }
+                if (UtilValidate.isNotEmpty(cancelledQuantity)) {
+                    shipGroupQuantity = shipGroupQuantity.subtract(cancelledQuantity);
+                }
+    
+                OrderReadHelper orh = new OrderReadHelper(delegator, orderId);
+                BigDecimal shippedQuantity = null;
                 shippedQuantity = orh.getItemShippedQuantity(genericResult.getRelatedOne("OrderItem", false));
-            } catch (GenericEntityException e) {
-            }
-            if (UtilValidate.isNotEmpty(shippedQuantity)) {
-                shipGroupQuantity = shipGroupQuantity.subtract(shippedQuantity);
-            }
-
-            GenericValue orderItemDeliverySchedule = null;
-            try {
+                if (UtilValidate.isNotEmpty(shippedQuantity)) {
+                    shipGroupQuantity = shipGroupQuantity.subtract(shippedQuantity);
+                }
+    
+                GenericValue orderItemDeliverySchedule = null;
                 orderItemDeliverySchedule = EntityQuery.use(delegator).from("OrderDeliverySchedule").where("orderId", orderId, "orderItemSeqId", genericResult.getString("orderItemSeqId")).queryOne();
-            } catch (GenericEntityException e) {
-            }
-            Timestamp estimatedShipDate = null;
-            if (orderItemDeliverySchedule != null && orderItemDeliverySchedule.get("estimatedReadyDate") != null) {
-                estimatedShipDate = orderItemDeliverySchedule.getTimestamp("estimatedReadyDate");
-            } else if (orderDeliverySchedule != null && orderDeliverySchedule.get("estimatedReadyDate") != null) {
-                estimatedShipDate = orderDeliverySchedule.getTimestamp("estimatedReadyDate");
-            } else {
-                estimatedShipDate = genericResult.getTimestamp("oiEstimatedDeliveryDate");
-            }
-            if (estimatedShipDate == null) {
-                estimatedShipDate = now;
-            }
-
-            parameters = UtilMisc.toMap("mrpId", mrpId, "productId", productId, "eventDate", estimatedShipDate, "mrpEventTypeId", "PUR_ORDER_RECP");
-            try {
+                Timestamp estimatedShipDate = null;
+                if (orderItemDeliverySchedule != null && orderItemDeliverySchedule.get("estimatedReadyDate") != null) {
+                    estimatedShipDate = orderItemDeliverySchedule.getTimestamp("estimatedReadyDate");
+                } else if (orderDeliverySchedule != null && orderDeliverySchedule.get("estimatedReadyDate") != null) {
+                    estimatedShipDate = orderDeliverySchedule.getTimestamp("estimatedReadyDate");
+                } else {
+                    estimatedShipDate = genericResult.getTimestamp("oiEstimatedDeliveryDate");
+                }
+                if (estimatedShipDate == null) {
+                    estimatedShipDate = now;
+                }
+    
+                parameters = UtilMisc.toMap("mrpId", mrpId, "productId", productId, "eventDate", estimatedShipDate, "mrpEventTypeId", "PUR_ORDER_RECP");
                 InventoryEventPlannedServices.createOrUpdateMrpEvent(parameters, shipGroupQuantity, null, genericResult.getString("orderId") + "-" + genericResult.getString("orderItemSeqId"), false, delegator);
             } catch (GenericEntityException e) {
                 return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingMrpEventProblemInitializing", UtilMisc.toMap("mrpEventTypeId", "PUR_ORDER_RECP"), locale));