Author: apatel
Date: Mon Dec 3 16:42:55 2007 New Revision: 600748 URL: http://svn.apache.org/viewvc?rev=600748&view=rev Log: Replace all the calls to delegator.makeValue("WorkEffortInventoryProduced" in the manufacturing component to service calls Thanks Rishi Solanki for providing implementation And also our thanks to Vikas Mayur, Ashish Vijaywargiya, Mridul Pathak, Pankaj Savita and others for managing and helping the team implementing these services. Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=600748&r1=600747&r2=600748&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java (original) +++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Mon Dec 3 16:42:55 2007 @@ -1546,8 +1546,6 @@ Map resultService = dispatcher.runSync("createInventoryItem", serviceContext); String inventoryItemId = (String)resultService.get("inventoryItemId"); inventoryItemIds.add(inventoryItemId); - GenericValue inventoryProduced = delegator.makeValue("WorkEffortInventoryProduced", UtilMisc.toMap("workEffortId", productionRunId , "inventoryItemId", inventoryItemId)); - inventoryProduced.create(); serviceContext.clear(); serviceContext.put("inventoryItemId", inventoryItemId); serviceContext.put("workEffortId", productionRunId); @@ -1555,6 +1553,10 @@ serviceContext.put("quantityOnHandDiff", new Double(1)); serviceContext.put("userLogin", userLogin); resultService = dispatcher.runSync("createInventoryItemDetail", serviceContext); + serviceContext.clear(); + serviceContext.put("workEffortId", productionRunId); + serviceContext.put("inventoryItemId", inventoryItemId); + resultService = dispatcher.runSync("createWorkEffortInventoryProduced", serviceContext); // Recompute reservations serviceContext = new HashMap(); serviceContext.put("inventoryItemId", inventoryItemId); @@ -1579,8 +1581,6 @@ Map resultService = dispatcher.runSync("createInventoryItem", serviceContext); String inventoryItemId = (String)resultService.get("inventoryItemId"); inventoryItemIds.add(inventoryItemId); - GenericValue inventoryProduced = delegator.makeValue("WorkEffortInventoryProduced", UtilMisc.toMap("workEffortId", productionRunId , "inventoryItemId", inventoryItemId)); - inventoryProduced.create(); serviceContext.clear(); serviceContext.put("inventoryItemId", inventoryItemId); serviceContext.put("workEffortId", productionRunId); @@ -1588,6 +1588,10 @@ serviceContext.put("quantityOnHandDiff", quantity); serviceContext.put("userLogin", userLogin); resultService = dispatcher.runSync("createInventoryItemDetail", serviceContext); + serviceContext.clear(); + serviceContext.put("workEffortId", productionRunId); + serviceContext.put("inventoryItemId", inventoryItemId); + resultService = dispatcher.runSync("createWorkEffortInventoryProduced", serviceContext); // Recompute reservations serviceContext = new HashMap(); serviceContext.put("inventoryItemId", inventoryItemId); @@ -1665,8 +1669,6 @@ serviceContext.put("userLogin", userLogin); Map resultService = dispatcher.runSync("createInventoryItem", serviceContext); String inventoryItemId = (String)resultService.get("inventoryItemId"); - GenericValue inventoryProduced = delegator.makeValue("WorkEffortInventoryProduced", UtilMisc.toMap("workEffortId", productionRunTaskId , "inventoryItemId", inventoryItemId)); - inventoryProduced.create(); serviceContext.clear(); serviceContext.put("inventoryItemId", inventoryItemId); serviceContext.put("workEffortId", productionRunTaskId); @@ -1674,6 +1676,10 @@ serviceContext.put("quantityOnHandDiff", new Double(1)); serviceContext.put("userLogin", userLogin); resultService = dispatcher.runSync("createInventoryItemDetail", serviceContext); + serviceContext.clear(); + serviceContext.put("workEffortId", productionRunTaskId); + serviceContext.put("inventoryItemId", inventoryItemId); + resultService = dispatcher.runSync("createWorkEffortInventoryProduced", serviceContext); inventoryItemIds.add(inventoryItemId); // Recompute reservations serviceContext = new HashMap(); @@ -1699,9 +1705,6 @@ Map resultService = dispatcher.runSync("createInventoryItem", serviceContext); String inventoryItemId = (String)resultService.get("inventoryItemId"); - GenericValue inventoryProduced = delegator.makeValue("WorkEffortInventoryProduced", UtilMisc.toMap("workEffortId", productionRunTaskId , "inventoryItemId", inventoryItemId)); - inventoryProduced.create(); - serviceContext.clear(); serviceContext.put("inventoryItemId", inventoryItemId); serviceContext.put("workEffortId", productionRunTaskId); @@ -1709,6 +1712,10 @@ serviceContext.put("quantityOnHandDiff", quantity); serviceContext.put("userLogin", userLogin); resultService = dispatcher.runSync("createInventoryItemDetail", serviceContext); + serviceContext.clear(); + serviceContext.put("workEffortId", productionRunTaskId); + serviceContext.put("inventoryItemId", inventoryItemId); + resultService = dispatcher.runSync("createWorkEffortInventoryProduced", serviceContext); inventoryItemIds.add(inventoryItemId); // Recompute reservations serviceContext = new HashMap(); |
Hi, you should add also serviceContext.put("userLogin", userLogin); before calling createWorkEffortInventoryProduced service, because i am getting this error "User authorization is required for this service: createWorkEffortInventoryProduced"
Here it is: Index: applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java =================================================================== --- applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java (revision 600906) +++ applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java (working copy) @@ -1556,6 +1556,7 @@ serviceContext.clear(); serviceContext.put("workEffortId", productionRunId); serviceContext.put("inventoryItemId", inventoryItemId); + serviceContext.put("userLogin", userLogin); resultService = dispatcher.runSync("createWorkEffortInventoryProduced", serviceContext); // Recompute reservations serviceContext = new HashMap(); @@ -1591,6 +1592,7 @@ serviceContext.clear(); serviceContext.put("workEffortId", productionRunId); serviceContext.put("inventoryItemId", inventoryItemId); + serviceContext.put("userLogin", userLogin); resultService = dispatcher.runSync("createWorkEffortInventoryProduced", serviceContext); // Recompute reservations serviceContext = new HashMap(); @@ -1679,6 +1681,7 @@ serviceContext.clear(); serviceContext.put("workEffortId", productionRunTaskId); serviceContext.put("inventoryItemId", inventoryItemId); + serviceContext.put("userLogin", userLogin); resultService = dispatcher.runSync("createWorkEffortInventoryProduced", serviceContext); inventoryItemIds.add(inventoryItemId); // Recompute reservations @@ -1715,6 +1718,7 @@ serviceContext.clear(); serviceContext.put("workEffortId", productionRunTaskId); serviceContext.put("inventoryItemId", inventoryItemId); + serviceContext.put("userLogin", userLogin); resultService = dispatcher.runSync("createWorkEffortInventoryProduced", serviceContext); inventoryItemIds.add(inventoryItemId); // Recompute reservations |
Free forum by Nabble | Edit this page |