Package org.openwms.common.location
Class LocationController
java.lang.Object
org.openwms.core.http.AbstractWebController
org.openwms.common.location.LocationController
@Profile("!INMEM")
@Validated
@MeasuredRestController
public class LocationController
extends org.openwms.core.http.AbstractWebController
A LocationController.
- Author:
- Heiko Scherrer
-
Field Summary
Modifier and TypeFieldDescriptionprivate final LocationRemovalManager
private final LocationService
private final LocationMapper
private final org.ameba.i18n.Translator
-
Constructor Summary
ConstructorDescriptionLocationController
(LocationService locationService, LocationMapper mapper, org.ameba.i18n.Translator translator, LocationRemovalManager locationRemovalManager) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addSelfLink
(LocationVO result) private void
changeLocation
(LockMode mode, Target target, Integer plcState, BiConsumer<Target, ErrorCodeVO> fnc) org.springframework.http.ResponseEntity
<Void> changeState
(String pKey, String op, ErrorCodeVO errorCode) org.springframework.http.ResponseEntity
<Void> changeState
(String locationId, ErrorCodeVO errorCode) org.springframework.http.ResponseEntity
<Void> changeState
(String erpCode, LockType type, LockMode mode, Integer plcState) Change the currentmode
aLocation
, identified byerpCode
.org.springframework.http.ResponseEntity
<LocationVO> createLocation
(@Valid LocationVO location, jakarta.servlet.http.HttpServletRequest req) org.springframework.http.ResponseEntity
<Void> deleteLocation
(String pKey) org.springframework.http.ResponseEntity
<LocationVO> findByCoordinate
(String locationId) org.springframework.http.ResponseEntity
<List<LocationVO>> org.springframework.http.ResponseEntity
<LocationVO> findByErpCode
(String erpCode) org.springframework.http.ResponseEntity
<LocationVO> findByPKey
(String pKey) org.springframework.http.ResponseEntity
<LocationVO> findByPlcCode
(String plcCode) org.springframework.http.ResponseEntity
<List<LocationVO>> findForLocationGroups
(List<String> locationGroupNames) org.springframework.http.ResponseEntity
<org.openwms.core.http.Index> index()
private org.ameba.exception.NotFoundException
locationNotFound
(String erpCode) private void
unsupportedOperation
(LockMode mode) private void
unsupportedOperation
(LockType type) org.springframework.http.ResponseEntity
<LocationVO> updateLocation
(@Valid LocationVO location) Methods inherited from class org.openwms.core.http.AbstractWebController
buildNOKResponse, buildNOKResponseWithKey, buildOKResponse, buildResponse, buildResponse, getLocationForCreatedResource, getLocationURIForCreatedResource, handleBehaviorAwareException, handleBusinessRuntimeException, handleConstraintViolationException, handleException, handleHttpBusinessException, handleRemovalNotAllowedException, handleTechnicalRuntimeException, handleValidationException, illegalArgumentException, translate
-
Field Details
-
mapper
-
translator
private final org.ameba.i18n.Translator translator -
locationService
-
locationRemovalManager
-
-
Constructor Details
-
LocationController
LocationController(LocationService locationService, LocationMapper mapper, org.ameba.i18n.Translator translator, LocationRemovalManager locationRemovalManager)
-
-
Method Details
-
createLocation
@PostMapping("/v1/locations") @Validated(Create.class) public org.springframework.http.ResponseEntity<LocationVO> createLocation(@Valid @RequestBody @Valid LocationVO location, jakarta.servlet.http.HttpServletRequest req) -
updateLocation
@PutMapping("/v1/locations") @Validated(Update.class) public org.springframework.http.ResponseEntity<LocationVO> updateLocation(@Valid @RequestBody @Valid LocationVO location) -
deleteLocation
-
findByPKey
@GetMapping("/v1/locations/{pKey}") public org.springframework.http.ResponseEntity<LocationVO> findByPKey(@PathVariable("pKey") String pKey) -
addSelfLink
-
findByCoordinate
@GetMapping(value="/v1/locations", params="locationId") public org.springframework.http.ResponseEntity<LocationVO> findByCoordinate(@RequestParam("locationId") String locationId) -
findByErpCode
@GetMapping(value="/v1/locations", params="erpCode") public org.springframework.http.ResponseEntity<LocationVO> findByErpCode(@RequestParam("erpCode") String erpCode) -
findByPlcCode
@GetMapping(value="/v1/locations", params="plcCode") public org.springframework.http.ResponseEntity<LocationVO> findByPlcCode(@RequestParam("plcCode") String plcCode) -
findForLocationGroups
@GetMapping(value="/v1/locations", params="locationGroupNames") public org.springframework.http.ResponseEntity<List<LocationVO>> findForLocationGroups(@RequestParam("locationGroupNames") List<String> locationGroupNames) -
changeState
@PatchMapping(value="/v1/location/{pKey}", params="op=change-state") public org.springframework.http.ResponseEntity<Void> changeState(@PathVariable(name="pKey") String pKey, @RequestParam(name="op") String op, @RequestBody ErrorCodeVO errorCode) -
changeState
@PatchMapping(value="/v1/location", params={"locationId","op=change-state"}) public org.springframework.http.ResponseEntity<Void> changeState(@RequestParam(name="locationId") String locationId, @RequestBody ErrorCodeVO errorCode) -
changeState
@PostMapping(path="/v1/locations", params={"erpCode","type!=PERMANENT_LOCK","mode"}) public org.springframework.http.ResponseEntity<Void> changeState(@RequestParam("erpCode") String erpCode, @RequestParam("type") LockType type, @RequestParam("mode") LockMode mode, @RequestParam(value="plcState",required=false) Integer plcState) Change the currentmode
aLocation
, identified byerpCode
.- Parameters:
erpCode
- The ERP code of the Locationtype
- The type of lock to apply to the Locationmode
- The mode to apply to the Locations lock
-
findByCoordinate
@GetMapping("/v1/locations") public org.springframework.http.ResponseEntity<List<LocationVO>> findByCoordinate(@RequestParam(value="area",required=false,defaultValue="%") String area, @RequestParam(value="aisle",required=false,defaultValue="%") String aisle, @RequestParam(value="x",required=false,defaultValue="%") String x, @RequestParam(value="y",required=false,defaultValue="%") String y, @RequestParam(value="z",required=false,defaultValue="%") String z) -
index
@GetMapping("/v1/locations/index") public org.springframework.http.ResponseEntity<org.openwms.core.http.Index> index() -
changeLocation
private void changeLocation(LockMode mode, Target target, Integer plcState, BiConsumer<Target, ErrorCodeVO> fnc) -
locationNotFound
-
unsupportedOperation
-
unsupportedOperation
-