This is an automated email from the ASF dual-hosted git repository. diveshdut pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
commit cdd19c9f6aeb2ca4dcaa469ff0fa1699c4aed48c Author: diveshdut <[email protected]> AuthorDate: Tue Aug 11 16:23:53 2026 +0530 OFBIZ-13422: Add manufacturing facility lookup services Add lookup services for manufacturing facilities and manufacturing plants, and narrow the existing warehouse lookup to warehouse facilities only. These services provide paged facility options for production run find and create workflows. --- .../manufacturing/servicedef/services_lookup.xml | 26 ++++++++++++++++++++++ .../api/ManufacturingLookupServices.groovy | 10 ++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/applications/manufacturing/servicedef/services_lookup.xml b/applications/manufacturing/servicedef/services_lookup.xml index 13b8e493ce..df53c8f9a6 100644 --- a/applications/manufacturing/servicedef/services_lookup.xml +++ b/applications/manufacturing/servicedef/services_lookup.xml @@ -28,6 +28,32 @@ under the License. <attribute mode="OUT" name="costComponentTypes" optional="false" type="java.util.List"/> <attribute mode="OUT" name="costComponentCalcs" optional="false" type="java.util.List"/> </service> + <service name="findManufacturingFacilities" engine="groovy" auth="true" + location="component://manufacturing/src/main/groovy/org/apache/ofbiz/manufacturing/api/ManufacturingLookupServices.groovy" invoke="findManufacturingFacilities"> + <description>Find warehouse and plant facilities available for manufacturing application workflows.</description> + <permission-service service-name="manufacturingPermissionService" main-action="VIEW"/> + <attribute mode="IN" name="pageIndex" optional="true" type="Integer"/> + <attribute mode="IN" name="pageSize" optional="true" type="Integer"/> + <attribute mode="OUT" name="pageIndex" optional="false" type="Integer"/> + <attribute mode="OUT" name="pageSize" optional="false" type="Integer"/> + <attribute mode="OUT" name="totalCount" optional="false" type="Long"/> + <attribute mode="OUT" name="totalPages" optional="false" type="Long"/> + <attribute mode="OUT" name="hasNext" optional="false" type="Boolean"/> + <attribute mode="OUT" name="facilities" optional="false" type="java.util.List"/> + </service> + <service name="findManufacturingPlants" engine="groovy" auth="true" + location="component://manufacturing/src/main/groovy/org/apache/ofbiz/manufacturing/api/ManufacturingLookupServices.groovy" invoke="findManufacturingPlants"> + <description>Find plant facilities available for manufacturing application workflows.</description> + <permission-service service-name="manufacturingPermissionService" main-action="VIEW"/> + <attribute mode="IN" name="pageIndex" optional="true" type="Integer"/> + <attribute mode="IN" name="pageSize" optional="true" type="Integer"/> + <attribute mode="OUT" name="pageIndex" optional="false" type="Integer"/> + <attribute mode="OUT" name="pageSize" optional="false" type="Integer"/> + <attribute mode="OUT" name="totalCount" optional="false" type="Long"/> + <attribute mode="OUT" name="totalPages" optional="false" type="Long"/> + <attribute mode="OUT" name="hasNext" optional="false" type="Boolean"/> + <attribute mode="OUT" name="facilities" optional="false" type="java.util.List"/> + </service> <service name="findFixedAssets" engine="groovy" auth="true" location="component://manufacturing/src/main/groovy/org/apache/ofbiz/manufacturing/api/ManufacturingLookupServices.groovy" invoke="findFixedAssets"> <description>Find fixed assets available to manufacturing workflows, with REST paging and sorting, so routing and other manufacturing applications can select equipment or tool references from a stable lookup payload.</description> diff --git a/applications/manufacturing/src/main/groovy/org/apache/ofbiz/manufacturing/api/ManufacturingLookupServices.groovy b/applications/manufacturing/src/main/groovy/org/apache/ofbiz/manufacturing/api/ManufacturingLookupServices.groovy index 50750d5a5c..84013dbc1c 100644 --- a/applications/manufacturing/src/main/groovy/org/apache/ofbiz/manufacturing/api/ManufacturingLookupServices.groovy +++ b/applications/manufacturing/src/main/groovy/org/apache/ofbiz/manufacturing/api/ManufacturingLookupServices.groovy @@ -184,6 +184,14 @@ Map findCostComponentOptions() { } Map findWarehouses() { + return findFacilitiesByTypes(['WAREHOUSE']) +} + +Map findManufacturingPlants() { + return findFacilitiesByTypes(['PLANT']) +} + +Map findManufacturingFacilities() { return findFacilitiesByTypes(['WAREHOUSE', 'PLANT']) } @@ -202,7 +210,7 @@ Map findFacilitiesByTypes(List facilityTypeIds) { .queryPagedList(queryOptions.pageIndex, queryOptions.pageSize).getData() .collect { GenericValue facility -> String facilityId = facility.facilityId - String facilityName = facility.facilityName ?: facilityId + String facilityName = ManufacturingServiceUtil.displayFacilityName(facility) String label = facilityName == facilityId ? facilityId : "${facilityName} [${facilityId}]".toString() [ facilityId: facilityId,

