Author: jacopoc
Date: Tue Jun 3 06:11:22 2008 New Revision: 662779 URL: http://svn.apache.org/viewvc?rev=662779&view=rev Log: Small enhancements to the algorithm that computes start/end dates of production runs. Modified: ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Modified: ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml?rev=662779&r1=662778&r2=662779&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml (original) +++ ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml Tue Jun 3 06:11:22 2008 @@ -56,8 +56,8 @@ location="org.ofbiz.manufacturing.jobshopmgt.ProductionRunServices" invoke="updateProductionRun" auth="true"> <description>Update a Production Run</description> <attribute name="productionRunId" type="String" mode="IN" optional="false"/> - <attribute name="quantity" type="Double" mode="IN"/> - <attribute name="estimatedStartDate" type="Timestamp" mode="IN"/> + <attribute name="quantity" type="Double" mode="IN" optional="true"/> + <attribute name="estimatedStartDate" type="Timestamp" mode="IN" optional="true"/> <attribute name="workEffortName" type="String" mode="IN" optional="true"/> <attribute name="description" type="String" mode="IN" optional="true"/> <attribute name="facilityId" type="String" mode="IN" optional="true"/> 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=662779&r1=662778&r2=662779&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 Tue Jun 3 06:11:22 2008 @@ -1067,13 +1067,7 @@ LocalDispatcher dispatcher = ctx.getDispatcher(); Locale locale = (Locale) context.get("locale"); GenericValue userLogin = (GenericValue) context.get("userLogin"); - /* TODO: security management and finishing cleaning (ex copy from PartyServices.java) - if (!security.hasEntityPermission(secEntity, secOperation, userLogin)) { - result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR); - result.put(ModelService.ERROR_MESSAGE, "You do not have permission to perform this operation for this party"); - return partyId; - } - */ + String productionRunId = (String) context.get("productionRunId"); String routingTaskId = (String) context.get("routingTaskId"); if (! UtilValidate.isEmpty(productionRunId) && ! UtilValidate.isEmpty(routingTaskId)) { @@ -1088,7 +1082,11 @@ Timestamp estimatedStartDate = (Timestamp) context.get("estimatedStartDate"); Timestamp pRestimatedStartDate = productionRun.getEstimatedStartDate(); if (pRestimatedStartDate.after(estimatedStartDate)) { - return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingRoutingTaskStartDateBeforePRun", locale)); + try { + Map resultService = dispatcher.runSync("updateProductionRun", UtilMisc.toMap("productionRunId", productionRunId, "estimatedStartDate", estimatedStartDate, "userLogin", userLogin)); + } catch (GenericServiceException e) { + return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingRoutingTaskStartDateBeforePRun", locale)); + } } Long priority = (Long) context.get("priority"); |
Free forum by Nabble | Edit this page |