Skip to content
Snippets Groups Projects
Commit 36d74875 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-7350 use map utils to get string from map

parent e7ea85e3
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,7 @@ package de.ozgcloud.collaboration; ...@@ -26,6 +26,7 @@ package de.ozgcloud.collaboration;
import java.util.function.Consumer; import java.util.function.Consumer;
import java.util.function.Predicate; import java.util.function.Predicate;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisher;
...@@ -81,13 +82,13 @@ class CollaborationEventListener { ...@@ -81,13 +82,13 @@ class CollaborationEventListener {
void createLevel1CollaborationRequest(CollaborationRequest collaborationRequest, Command command) { void createLevel1CollaborationRequest(CollaborationRequest collaborationRequest, Command command) {
var fachstelle = fachstelleService var fachstelle = fachstelleService
.getOrganisationEinheit((String) command.getBodyObject().get(CollaborationRequest.PROPERTY_ZUSTAENDIGE_STELLE)); .getOrganisationEinheit(MapUtils.getString(command.getBodyObject(), CollaborationRequest.PROPERTY_ZUSTAENDIGE_STELLE));
collaborationService.createCollaborationRequest(collaborationRequest.toBuilder().zustaendigeStelle(fachstelle).build()); collaborationService.createCollaborationRequest(collaborationRequest.toBuilder().zustaendigeStelle(fachstelle).build());
} }
void createLevel4CollaborationRequest(CollaborationRequest collaborationRequest, Command command) { void createLevel4CollaborationRequest(CollaborationRequest collaborationRequest, Command command) {
var fachstelle = fachstelleService var fachstelle = fachstelleService
.getExterneFachstelle((String) command.getBodyObject().get(CollaborationRequest.PROPERTY_ZUSTAENDIGE_STELLE)); .getExterneFachstelle(MapUtils.getString(command.getBodyObject(), CollaborationRequest.PROPERTY_ZUSTAENDIGE_STELLE));
collaborationService.createFachstellenBeteiligungRequest(collaborationRequest.toBuilder().zustaendigeStelle(fachstelle).build()); collaborationService.createFachstellenBeteiligungRequest(collaborationRequest.toBuilder().zustaendigeStelle(fachstelle).build());
} }
......
...@@ -40,8 +40,8 @@ public interface FachstelleMapper { ...@@ -40,8 +40,8 @@ public interface FachstelleMapper {
default Fachstelle fromMap(Map<?, ?> fachstelleMap) { default Fachstelle fromMap(Map<?, ?> fachstelleMap) {
return Fachstelle.builder() return Fachstelle.builder()
.technicalId((String) fachstelleMap.get(Fachstelle.PROPERTY_TECHNICAL_ID)) .technicalId(MapUtils.getString(fachstelleMap, Fachstelle.PROPERTY_TECHNICAL_ID))
.subjectId((String) fachstelleMap.get(Fachstelle.PROPERTY_SUBJECT_ID)) .subjectId(MapUtils.getString(fachstelleMap, Fachstelle.PROPERTY_SUBJECT_ID))
.type(FachstelleType.valueOf(MapUtils.getString(fachstelleMap, Fachstelle.PROPERTY_TYPE))) .type(FachstelleType.valueOf(MapUtils.getString(fachstelleMap, Fachstelle.PROPERTY_TYPE)))
.build(); .build();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment